[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] USPS address verification return values

Hi Jeff,

Sorry, I don't know why that would ever happen, I have not seen the debugger "just hang."

Also, the code example you pointed to in the archives appears to only be part of a program that was posted because the poster couldn't get it working.  I'm not familiar with the finished/working version of it.  I do see that the address fields are added to the XML document without escaping any special characters, which would be a bug if those characters happened to crop up.


On 4/2/2018 12:57 PM, Jeff Wilson wrote:


So I have the program compiling, but now it just hangs when I run it. When I debug it, I get to the H-spec and then hit F10 and it just hangs. Any idea what I am doing wrong? Thanks very much

Jeff Wilson

*From:*ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] *On Behalf Of *Scott Klement
*Sent:* Monday, March 26, 2018 7:01 PM
*To:* FTPAPI/HTTPAPI mailing list
*Subject:* Re: [Ftpapi] USPS address verification return values


The http_get_xml() routine will send it's output to the subprocedure(s)
that are called when parsing the XML.  In this case, it looks like
you've coded a subprocedure called "Incoming" that will receive them.
(But, you did not post the code for that procedure, so I don't know what
it is doing.)

I'm not familiar with this particular program.  Do you have a link to it
so I can see the rest of the code?


On 3/26/2018 4:00 PM, Jeff Wilson wrote:
> I am trying to use the program that was posted 4 years ago for the
> USPS verification of addresses. My question is, how to I get the
> results? The program works fine and send the data to USPS and gets a
> response, but how do I evaluate the response? I don’t see it coming
> back into a variable. I am an RPG guy, with almost no XML, so I must
> be missing something.
> Thanks very much
> d address1        s             38a    inz(*blanks)
> d address2        s             38a    inz('6406 Ivy Lane')
> d city            s             15a    inz('Greenbelt')
> d state           s              2a    inz('MD')
> d zip5            s              5a    inz(*blanks)
> d zip4            s              4a    inz(*blanks)
> //production
> url = 'http://production.shippingapis.com/ <https://protect-us.mimecast.com/s/QXIbCYEqmyFN7Qc9ymtK?domain=production.shippingapis.com> > <https://protect-us.mimecast.com/s/Qvz9CzpYz7swwXiX3e0Z?domain=production.shippingapis.com <https://protect-us.mimecast.com/s/QXIbCYEqmyFN7Qc9ymtK?domain=production.shippingapis.com>>';
> addressRequest =
>         '<AddressValidateRequest '+
>         'USERID="' + %trim(USPSUserID) + '">' +
>         '<Address ID="0">'+
>         '<Address1>' + %trim(Address1) +
>         '</Address1>' +
>         '<Address2>' + %trim(Address2) +
>         '</Address2>' +
>         '<City>' + %trim(City) +
>         '</City>' +
>         '<State>' + %trim(State) +
>         '</State>' +
>          '<Zip5>' + %trim(Zip5) +
>          '</Zip5>' +
>          '<Zip4>' + %trim(Zip4) +
>          '</Zip4>' +
> '</Address></AddressValidateRequest>';
> // encode the address request
> Enc = http_url_encoder_new();
> rc2 = http_url_encoder_addvar( Enc:
>             'XML':
>             %addr(addressRequest) + 2:
>             %len(addressRequest));
> bigString = http_url_encoder_getstr( Enc );
> urlValues =
>             'ShippingAPItest.dll?API=Verify&' +
>              bigString;
> // send request
> rc = http_get_xml(url +  urlValues:
>             *null: %paddr(Incoming): *null ); if rc <> 1;
>    msg = http_error;
>    dsply msg;
> Else;
> endif;

Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx <mailto:Ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
http://scottklement.com/mailman/listinfo/ftpapi <https://protect-us.mimecast.com/s/jq0OCZ6rnzcD6ECyxxXr?domain=scottklement.com>

Ftpapi mailing list