Hey all,
Has anyone had success using USPS's web tools for rates? Right now I use the below code. USPS tells me that the password is no longer looked for - or ignored if present.
I get the following returns - and I get the same return if i'm using the test server or the ssl server. And if I use post or get.
Code response is in this order: strXMLhttp.responseText, strXMLhttp.status, strXMLhttp.statusText
Thank you in advance.
Stuart
A+, Net+, Security+, MCP
Has anyone had success using USPS's web tools for rates? Right now I use the below code. USPS tells me that the password is no longer looked for - or ignored if present.
I get the following returns - and I get the same return if i'm using the test server or the ssl server. And if I use post or get.
Code response is in this order: strXMLhttp.responseText, strXMLhttp.status, strXMLhttp.statusText
Code:
80040b19 XML Syntax Error: Error getting USERID attribute. UspsCom::DoAuth
200
OK
Code:
<%
strXML= "<?xml version='1.0'?><RateV2Request USERID='xxxxxxxx'>"
strXML=strXML & "<Package ID='0'><Service>Priority</Service>"
strXML=strXML & "<ZipOrigination>10022</ZipOrigination>"
strXML=strXML & "<ZipDestination>20008</ZipDestination>"
strXML=strXML & "<Pounds>10</Pounds>"
strXML=strXML & "<Ounces>5</Ounces>"
strXML=strXML & "<Container>Flat Rate Box</Container>"
strXML=strXML & "<Size>REGULAR</Size>"
strXML=strXML & "</Package>"
strXML=strXML & "</RateV2Request>"
Set strXMLhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
strXMLhttp.Open "GET","[URL unfurl="true"]https://secure.shippingapis.com/ShippingAPITest.dll?API=RateV2&XML=",false[/URL]
strXMLhttp.setRequestHeader "Content-Type", "application/x-[URL unfurl="true"]www-form-urlencoded"[/URL]
strXMLhttp.send strXML
strResponseMessage = strXMLhttp.responseText
intHTTPStatusCode = strXMLhttp.status
strHTTPStatusText = strXMLhttp.statusText
response.write strResponseMessage & "<BR>"
response.write intHTTPStatusCode & "<BR>"
response.write strHTTPStatusText & "<BR>"
%>
Thank you in advance.
Stuart
A+, Net+, Security+, MCP