[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: USPS socket example
I wrote this little program the other day to test looking up a zip code from 
their test server.
You can probably use it with a few changes.
H DFTACTGRP(*NO) ACTGRP(*CALLER) BNDDIR('HTTPAPI')
 **********************************************************************
D/copy LIBHTTP/qrpglesrc,httpapi_h
 *
D cmd             pr                  extpgm('QCMDEXC')
D  command                     200a   const
D  length                       15p 5 const
 *
D rc              s             10i 0
D Url             s            256a
D enc             s                   like(HTTP_URL_ENCODER)
 **********************************************************************
 /Free
   http_debug(*on);
   enc = http_url_encoder_new();
   http_url_encoder_addvar_s( enc:
                             'API': 'CityStateLookup');
   http_url_encoder_addvar_s( enc:
                             'XML':
         '<CityStateLookupRequest USERID="xxxxxxxxxxx">+
             <ZipCode ID="0">+
                <Zip5>20770</Zip5>+
             </ZipCode>+
          </CityStateLookupRequest>');
  Url = 'http://testing.shippingapis.com/ShippingAPITest.dll?'
        + http_url_encoder_getstr(enc);
  http_url_encoder_free(enc);
  rc = http_url_get(Url: '/tmp/USPStest.csv');
  cmd('DSPF ''/tmp/USPStest.csv''': 200);
  *inLR = *on;
/End-Free
----- Original Message ----- 
From: "tim" <tim2006@xxxxxxxxxxx>
To: <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, July 20, 2007 10:35 AM
Subject: USPS socket example
> Can someone tell me which of the examples provided by Scott I could use to
> access the USPS web services API's to validate street addresses.
>
>
>
> http://production.shippingapis.com/ShippingAPITest.dll
>
>
>
> Thanks
>
>
--------------------------------------------------------------------------------
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
>
--------------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.10.10/908 - Release Date: 7/19/2007 
6:10 PM
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------