View Single Post
  #1 (permalink)  
Old October 10th, 2004, 02:57 PM
RobinR RobinR is offline
Authorized User
Join Date: Jul 2003
Location: , New Jersey, .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default XML Transmission to USPS

I am trying to send an XML transmission to the US Postal Service to retrieve shipping rates but so far have been unsuccessful. My latest HTTP Status code is 501 and the HTTP Status text is "Not Implemented". I have no problem sending successful transmissions to both Fedex or UPS but USPS does things differently.

According to the USPS documentation, the XML is sent to "" & "API=Rate&XML=" & XMLString

The XML and ASP code being used are below. Can anyone help with this? Unfortunately, the USPS technical staff doesn't appear to be too technical. Maybe they'll find someone who actually understands code but then again maybe not.



<RateRequest USERID="************" PASSWORD="************">
<Package ID="0">

<%Function SendXMLFiletoUSPS()%>
Dim RateType
Dim objSrvHTTP

RateType = "API=Rate&XML="
USPSURL = "" & "?" & RateType & strMessage & ""

Set objSrvHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP") "POST", USPSURL, false
objSrvHTTP.SetRequestHeader "Content-Type","application/x-www-form-urlencoded"
objSrvHTTP.send ""
strResponseMessage = objSrvHTTP.responseText
intHTTPStatusCode = objSrvHTTP.status
strHTTPStatusText = objSrvHTTP.statusText
<%End Function%>