SatishPutcha
Programmer
Hi all
I am trying to get an XML response by querying the UPS website. I am required to send a XML request to get the response. I am using the XMLHTTP object to send the request. The URL is secure connection i.e. HTTPS.
I am posting below all the code.
############################################################
<%
Response.Buffer = True
Set objxml = Server.CreateObject("Microsoft.XMLHTTP"
xmlstring="<?xml version=""1.0""?><AccessRequest xml:lang=""en-US""><AccessLicenseNumber>"
xmlstring=xmlstring&"TEST262223144CAT</AccessLicenseNumber><UserId>testUser</UserId>"
xmlstring=xmlstring&"<Password>testPW</Password></AccessRequest>"
xmlstring1 = "<?xml version=""1.0""?><RatingServiceSelectionRequest xml:lang=""en-US"">"
xmlstring1=xmlstring1&"<Request><TransactionReference><CustomerContext>Rating and Service"
xmlstring1=xmlstring1&"</CustomerContext><XpciVersion>1.0001</XpciVersion>"
xmlstring1=xmlstring1&"</TransactionReference><RequestAction>Rate</RequestAction>"
xmlstring1=xmlstring1&"<RequestOption>shop</RequestOption></Request><PickupType><Code>01"
xmlstring1=xmlstring1&"</Code></PickupType><Shipment><Shipper><Address><PostalCode>30076"
xmlstring1=xmlstring1&"</PostalCode></Address></Shipper><ShipTo><Address><PostalCode>30041"
xmlstring1=xmlstring1&"</PostalCode></Address></ShipTo><Service><Code>11</Code></Service>"
xmlstring1=xmlstring1&"<Package><PackagingType><Code>02</Code><Description>Package"
xmlstring1=xmlstring1&"</Description></PackagingType><Description>Rate Shopping"
xmlstring1=xmlstring1&"</Description><PackageWeight><Weight>33</Weight></PackageWeight>"
xmlstring1=xmlstring1&"</Package><ShipmentServiceOptions/></Shipment>"
xmlstring1=xmlstring1&"</RatingServiceSelectionRequest>"
objxml.Open "POST"," objxml.Send xmlString&xmlString1
Response.Write objxml.responsetext
Set objxml = Nothing
%>
############################################################
"xmlstring" has the login details and "xmlstring1" has the package details for which we need the shipping information.
I am getting a "Server.CreateObject Failed " on the line " objxml.Send xmlString&xmlString1".
Please help me out.What am i doing wrong?
Regards
Satish
I am trying to get an XML response by querying the UPS website. I am required to send a XML request to get the response. I am using the XMLHTTP object to send the request. The URL is secure connection i.e. HTTPS.
I am posting below all the code.
############################################################
<%
Response.Buffer = True
Set objxml = Server.CreateObject("Microsoft.XMLHTTP"
xmlstring="<?xml version=""1.0""?><AccessRequest xml:lang=""en-US""><AccessLicenseNumber>"
xmlstring=xmlstring&"TEST262223144CAT</AccessLicenseNumber><UserId>testUser</UserId>"
xmlstring=xmlstring&"<Password>testPW</Password></AccessRequest>"
xmlstring1 = "<?xml version=""1.0""?><RatingServiceSelectionRequest xml:lang=""en-US"">"
xmlstring1=xmlstring1&"<Request><TransactionReference><CustomerContext>Rating and Service"
xmlstring1=xmlstring1&"</CustomerContext><XpciVersion>1.0001</XpciVersion>"
xmlstring1=xmlstring1&"</TransactionReference><RequestAction>Rate</RequestAction>"
xmlstring1=xmlstring1&"<RequestOption>shop</RequestOption></Request><PickupType><Code>01"
xmlstring1=xmlstring1&"</Code></PickupType><Shipment><Shipper><Address><PostalCode>30076"
xmlstring1=xmlstring1&"</PostalCode></Address></Shipper><ShipTo><Address><PostalCode>30041"
xmlstring1=xmlstring1&"</PostalCode></Address></ShipTo><Service><Code>11</Code></Service>"
xmlstring1=xmlstring1&"<Package><PackagingType><Code>02</Code><Description>Package"
xmlstring1=xmlstring1&"</Description></PackagingType><Description>Rate Shopping"
xmlstring1=xmlstring1&"</Description><PackageWeight><Weight>33</Weight></PackageWeight>"
xmlstring1=xmlstring1&"</Package><ShipmentServiceOptions/></Shipment>"
xmlstring1=xmlstring1&"</RatingServiceSelectionRequest>"
objxml.Open "POST"," objxml.Send xmlString&xmlString1
Response.Write objxml.responsetext
Set objxml = Nothing
%>
############################################################
"xmlstring" has the login details and "xmlstring1" has the package details for which we need the shipping information.
I am getting a "Server.CreateObject Failed " on the line " objxml.Send xmlString&xmlString1".
Please help me out.What am i doing wrong?
Regards
Satish