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. 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