<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<big>This should be simple, but it's got me stumped.<br>
<br>
First, plug the following URL into any browser (Mozilla, IE,
Thunderbird, Safari, or whatever, all one line in the URL panel):</big><br>
<br>
<tt><a class="moz-txt-link-freetext" href="http://testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=">http://testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=</a><AddressValidateRequest
><Address
ID="0"><Address1></Address1><Address2>6406 Ivy
Lane</Address2><City>Greenbelt</City><State>MD</State><Zip5></Zip5><Zip4></Zip4></Address></AddressValidateRequest></tt><br>
<br>
<big>You should get back the following response from the
shippingapis.com machine:</big><br>
<br>
<tt><Error><br>
<Number>80040b19</Number><br>
<Description>XML Syntax Error: Error getting USERID
attribute.</Description><br>
<Source>UspsCom::DoAuth</Source><br>
</Error><br>
</tt><big><br>
And, this is how it should be. And, I would like to duplicate this
behavior via Squeak code. So, I try, for example, the following:<br>
<br>
<small><tt>HTTPClient httpGetDocument:
'<a class="moz-txt-link-freetext" href="http://testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=">http://testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=</a><AddressValidateRequest><Address
ID="0"><Address1></Address1><Address2>6406 Ivy
Lane</Address2><City>Greenbelt</City><State>MD</State><Zip5></Zip5><Zip4></Zip4></Address></AddressValidateRequest>'</tt><br>
</small><br>
I would think that the above would be the programmatic equivalent of
the URL I typed into Thunderbird (I also tried it with Safari, and both
Safari and Thunderbird gave me the same results). But when I do it
programmatically in Squeak, I get back this response:<br>
<br>
<small><tt>HTTP/1.1 400 Bad Request<br>
Server: Microsoft-IIS/5.0<br>
Date: Tue, 27 Dec 2005 03:46:44 GMT<br>
Content-Type: text/html<br>
Content-Length:
87<html><head><title>Error</title></head><body>The
parameter is incorrect. </body></html></tt></small><br>
<br>
I was expecting the "XML Syntax Error" response that Thunderbird (as
well as Safari) gave me instead of this nonsense. But I instead got
back something totally different. Why?<br>
<br>
OK, let's try Scamper. So, I plug in the URL I mentioned, and I get
the following response in Scamper:<br>
<small><tt><br>
error occured retrieving
<a class="moz-txt-link-freetext" href="http://testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=">http://testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=</a><AddressValidateRequest
><Address
ID="0"><Address1></Address1><Address2>6406 Ivy
Lane</Address2><City>Greenbelt</City><State>MD</State><Zip5></Zip5><Zip4></Zip4></Address></AddressValidateRequest>:
HTTP/1.1 400 Bad Request<br>
Server: Microsoft-IIS/5.0<br>
Date: Tue, 27 Dec 2005 03:50:47 GMT<br>
Content-Type: text/html<br>
Content-Length:
87<html><head><title>Error</title></head><body>The
parameter is incorrect. </body></html></tt></small><br>
<br>
So, Scamper is also giving me something different from the "XML Syntax
Error" response I was expecting. Why?<br>
<br>
I've tried every combination of GET and/or POST I could think of. I
just don't understand why Squeak is giving me a different result than
Thunderbird gives me. Anybody know?<br>
<br>
In case you are curious, if I include my login ID as an XML arg of the
URL, the shippingapis.com machine will validate my address(es) that I
pass to it. I just didn't think it would be a good idea to post my
login ID. Besides, it is unnecessary to do so, because if I solve the
above problem, I will solve my *real* problem, and will be able to
programmatically validate any US-based address.<br>
<br>
Anybody know why Squeak is giving me different results than the web
browsers do?<br>
<br>
Nevin<br>
<br>
</big>
</body>
</html>