× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ha.. I figured it out... they weren't encoding the XML.

Still weird they won't take a POST...

On Thu, Jan 6, 2022 at 11:00 AM Brad Stone <bvstone@xxxxxxxxx> wrote:

Sending XML in a Query String.. only our government would think that's a
good idea.

I'm still getting 505 - HTTP Version Not Supported errors from them using
GETURI. Postman with the exact same request seems to work.

On Thu, Jan 6, 2022 at 10:29 AM Sam_L <lennon_s_j@xxxxxxxxxxx> wrote:

Apologies to the USPS--I not longer can find any error in their
examples. Likely old eyes and fat fingers on my part.

For the record, here's an example of what I have found works (formatted
for hopefully better readability):

values QSYS2.HTTP_GET('http://production.shippingapis.com/ShippingAPI.dll
'
concat '?API=Verify&XML=' concat
url_encode(
'<AddressValidateRequest USERID="126NONE03897">' concat
'<Revision>1</Revision>' concat
'<Address ID="0">' concat
'<Address1>Suite 2</Address1>' concat
'<Address2>8 Wildwood Drive</Address2>' concat
'<City>Old Lyme</City>' concat
'<State>CT</State>' concat
'<Zip5/>' concat
'<Zip4/>' concat
'</Address>' concat
'</AddressValidateRequest>')
)
;

It returns an XML string like this (again formatted for hopefully better
readability):

<?xml version="1.0" encoding="UTF-8"?>
<AddressValidateResponse>
<Address ID="0">
<Address1>STE 2</Address1>
<Address2>8 WILDWOOD DR</Address2>
<City>OLD LYME</City>
<State>CT</State>
<Zip5>06371</Zip5>
<Zip4>1844</Zip4>
<DeliveryPoint>08</DeliveryPoint>
<CarrierRoute>R010</CarrierRoute>
<Footnotes>N</Footnotes>
<DPVConfirmation>S</DPVConfirmation>
<DPVCMRA>N</DPVCMRA>
<DPVFootnotes>AACC</DPVFootnotes>
<Business>N</Business>
<CentralDeliveryPoint>N</CentralDeliveryPoint>
<Vacant>N</Vacant>
</Address>
</AddressValidateResponse>

Note that it has standardized the address and filled in the ZIP and ZIP+4.

You could also omit the city name but provided the zip and it will
figure out the city name.

Sam

On 1/5/2022 2:08 PM, Jack Woehr via MIDRANGE-L wrote:

Now I've got to figure out why some of the USPS examples, which I
copied, don't seem to work.


Um, Sam, I assume that you've, like, visited the Post Office before ...
:)


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.