<!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>
&nbsp;&nbsp; <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&amp;XML=</a>&lt;AddressValidateRequest
&gt;&lt;Address
ID="0"&gt;&lt;Address1&gt;&lt;/Address1&gt;&lt;Address2&gt;6406 Ivy
Lane&lt;/Address2&gt;&lt;City&gt;Greenbelt&lt;/City&gt;&lt;State&gt;MD&lt;/State&gt;&lt;Zip5&gt;&lt;/Zip5&gt;&lt;Zip4&gt;&lt;/Zip4&gt;&lt;/Address&gt;&lt;/AddressValidateRequest&gt;</tt><br>
<br>
<big>You should get back the following response from the
shippingapis.com machine:</big><br>
<br>
&nbsp;&nbsp; <tt>&lt;Error&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;Number&gt;80040b19&lt;/Number&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;Description&gt;XML Syntax Error: Error getting USERID
attribute.&lt;/Description&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;Source&gt;UspsCom::DoAuth&lt;/Source&gt;<br>
&lt;/Error&gt;<br>
</tt><big><br>
And, this is how it should be.&nbsp; And, I would like to duplicate this
behavior via Squeak code.&nbsp; 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&amp;XML=</a>&lt;AddressValidateRequest&gt;&lt;Address
ID="0"&gt;&lt;Address1&gt;&lt;/Address1&gt;&lt;Address2&gt;6406 Ivy
Lane&lt;/Address2&gt;&lt;City&gt;Greenbelt&lt;/City&gt;&lt;State&gt;MD&lt;/State&gt;&lt;Zip5&gt;&lt;/Zip5&gt;&lt;Zip4&gt;&lt;/Zip4&gt;&lt;/Address&gt;&lt;/AddressValidateRequest&gt;'</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).&nbsp; 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&lt;html&gt;&lt;head&gt;&lt;title&gt;Error&lt;/title&gt;&lt;/head&gt;&lt;body&gt;The
parameter is incorrect. &lt;/body&gt;&lt;/html&gt;</tt></small><br>
<br>
I was expecting the "XML Syntax Error" response that Thunderbird (as
well as Safari) gave me instead of this nonsense.&nbsp; But I instead got
back something totally different.&nbsp; Why?<br>
<br>
OK, let's try Scamper.&nbsp; 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&amp;XML=</a>&lt;AddressValidateRequest
&gt;&lt;Address
ID="0"&gt;&lt;Address1&gt;&lt;/Address1&gt;&lt;Address2&gt;6406 Ivy
Lane&lt;/Address2&gt;&lt;City&gt;Greenbelt&lt;/City&gt;&lt;State&gt;MD&lt;/State&gt;&lt;Zip5&gt;&lt;/Zip5&gt;&lt;Zip4&gt;&lt;/Zip4&gt;&lt;/Address&gt;&lt;/AddressValidateRequest&gt;:
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&lt;html&gt;&lt;head&gt;&lt;title&gt;Error&lt;/title&gt;&lt;/head&gt;&lt;body&gt;The
parameter is incorrect. &lt;/body&gt;&lt;/html&gt;</tt></small><br>
<br>
So, Scamper is also giving me something different from the "XML Syntax
Error" response I was expecting.&nbsp; Why?<br>
<br>
I've tried every combination of GET and/or POST I could think of.&nbsp; I
just don't understand why Squeak is giving me a different result than
Thunderbird gives me.&nbsp; 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.&nbsp; I just didn't think it would be a good idea to post my
login ID.&nbsp; 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>