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

Re: [Ftpapi] USPS address verification return values



Scott

 

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

 

Jeff,

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?

-SK



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 = '';
> 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
http://scottklement.com/mailman/listinfo/ftpapi

-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi