Fighting with all kinds of new things...
** CURL in Ubuntu: This works.
curl -v -G --trace-ascii log.txt --data-urlencode
'XML=<AddressValidateRequest USERID="xxxxxxxx"><Address
ID="0"><Address1></Address1><Address2>6406 Ivy
Lane</Address2><City>Greenbelt</City><State>MD</State><Zip5></Zip5><Zip4></Zip4></Address></AddressValidateRequest>'
http://production.shippingapis.com/ShippingApi.dll?API=Verify
(It is really ugly as one long string, but I don't know how to break it
to separate lines. Tried \, but urlencode kept them. Don't know how the
line will look when posted.)
** CURL in QP2TERM on Pub400.com: Works, using the above command.
** QSYS2.HTTP_GET on PUB400.com: FAILS (using the same big ugly string.)
values QSYS2.HTTP_GET('
http://production.shippingapis.com/ShippingAPI.dll'
concat '?API=Verify&' concat
url_encode(
'XML=<AddressValidateRequest USERID="xxxxxxxx"><Address
ID="0"><Address1></Address1><Address2>6406 Ivy
Lane</Address2><City>Greenbelt</City><State>MD</State><Zip5></Zip5><Zip4></Zip4></Address></AddressValidateRequest>'
),
'{
"header":"Content-Type,text/xml",
"header":"Accept,*",
"header":"Content type,charset=UTF-8"
}'
)
;
Error: 80040B18, An error has occurred with the service. Please contact
the system administrator, or try again.
** Could it be a CCSID issue? Pub400.com is German, CCSID(273) but i'm
running in the USA which I believe means Run SQL Scripts is running in
CCSID(37). I tried CL: CHGJOB CCSID(037) first but it made no
difference, though the QZDASOINIT job did change. Don't see a way to
change the JDBC ccsid. Is url_encode ccsid sensitive?
I tried this to verify url_encode looked good and it seems to work fine.
values url_decode(url_encode(
'XML=<AddressValidateRequest USERID="xxxxxxxx"><Address
ID="0"><Address1></Address1><Address2>6406 Ivy
Lane</Address2><City>Greenbelt</City><State>MD</State><Zip5></Zip5><Zip4></Zip4></Address></AddressValidateRequest>'
));
On 1/4/2022 10:39 AM, Jack Woehr via MIDRANGE-L wrote:
You're welcome, and keep us ... um ... "posted" on what you find out.
I'm sure many of us at one time or another will have to do EDI with USPS!
As an Amazon Associate we earn from qualifying purchases.