Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get ups rate 1

Status
Not open for further replies.

ecalbert

Programmer
Dec 25, 2004
61
IL
I tried the script at and it works great -- one thing is that if the weight is too much it doesn't return any prices -- does ups have a limit? Anyway to get a error message returned so that I know why it is erroring?
 
The raw response is assigned to a variable here:
Code:
strXMLResponse = strXMLhttp.responseText

Additionally you can look at the Status property of the strXMLhttp object to see what the browser status was (200=OK, 404=Page Not Found, etc)

If you Response.Write the variable above you might get more information from the raw XML that was (hopefully) returned.

 
thanks -- can you tell me how I can pull the error out of the below response?

<?xml version="1.0"?><RatingServiceSelectionResponse><Response>
<TransactionReference><CustomerContext>Rating and Service</CustomerContext><XpciVersion>1.0001</XpciVersion>
</TransactionReference><ResponseStatusCode>0</ResponseStatusCode>
<ResponseStatusDescription>Failure</ResponseStatusDescription><Error>
<ErrorSeverity>Hard</ErrorSeverity><ErrorCode>111035</ErrorCode>
<ErrorDescription>The maximum per package weight for the selected service from the selected country is 150 pounds.</ErrorDescription></Error></Response></
RatingServiceSelectionResponse>
 
[tt]dim onode, errmsg, ochildnode
set onode=mydoc.selectSingleNode("/RatingServiceSelectionResponse/Response/Error")
if onode is nothing then
'etc etc : the existing functionality
else
errmsg=""
for each ochildnode in onode.childNodes
errmsg=errmsg & ochildnode.nodename & " : " & ochildnode.text & "<br />"
next
response.write errmsg
end if
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top