     H DFTACTGRP(*NO) ACTGRP('KLEMENT') BNDDIR('HTTPAPI')

      /copy HTTPAPI_H
      /copy IFSIO_H

     D url             s           1000a   varying
     D stmf            s           1000a   varying
     D rc              s             10i 0
     D errMsg          s             52a   varying

     D custInfo        ds                  qualified
     D   id                           4s 0
     D   name                        25a
     D   street                      25a
     D   city                        15a
     D   state                        2a
     D   postal                      10a

     C     *ENTRY        PLIST
     C                   PARM                    InputCust        15 5

      /free

        stmf = '/tmp/getcust.xml';
        url = 'http://plbox:8556/cust/'
            + %char(%int(InputCust));

        rc = http_get(url: stmf);
        if (rc<>1 and rc<>500);
           http_crash();
        endif;

        if rc=500;
           xml-into errMsg %xml(stmf: 'path=error doc=file');
           dsply errMsg;
        else;
           xml-into custInfo %xml(stmf: 'path=result/cust doc=file');
           dsply custInfo.name;
           dsply custInfo.street;
           dsply ( custInfo.city + ' '
                 + custInfo.state + ' '
                 + custInfo.postal );
        endif;

        unlink(stmf);

        *inlr = *on;
      /end-free
