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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XMLHTTP for HTTPS site

Status
Not open for further replies.

SatishPutcha

Programmer
Mar 12, 2002
256
IN
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(&quot;Microsoft.XMLHTTP&quot;)

xmlstring=&quot;<?xml version=&quot;&quot;1.0&quot;&quot;?><AccessRequest xml:lang=&quot;&quot;en-US&quot;&quot;><AccessLicenseNumber>&quot;
xmlstring=xmlstring&&quot;TEST262223144CAT</AccessLicenseNumber><UserId>testUser</UserId>&quot;
xmlstring=xmlstring&&quot;<Password>testPW</Password></AccessRequest>&quot;

xmlstring1 = &quot;<?xml version=&quot;&quot;1.0&quot;&quot;?><RatingServiceSelectionRequest xml:lang=&quot;&quot;en-US&quot;&quot;>&quot;
xmlstring1=xmlstring1&&quot;<Request><TransactionReference><CustomerContext>Rating and Service&quot;
xmlstring1=xmlstring1&&quot;</CustomerContext><XpciVersion>1.0001</XpciVersion>&quot;
xmlstring1=xmlstring1&&quot;</TransactionReference><RequestAction>Rate</RequestAction>&quot;
xmlstring1=xmlstring1&&quot;<RequestOption>shop</RequestOption></Request><PickupType><Code>01&quot;
xmlstring1=xmlstring1&&quot;</Code></PickupType><Shipment><Shipper><Address><PostalCode>30076&quot;
xmlstring1=xmlstring1&&quot;</PostalCode></Address></Shipper><ShipTo><Address><PostalCode>30041&quot;
xmlstring1=xmlstring1&&quot;</PostalCode></Address></ShipTo><Service><Code>11</Code></Service>&quot;
xmlstring1=xmlstring1&&quot;<Package><PackagingType><Code>02</Code><Description>Package&quot;
xmlstring1=xmlstring1&&quot;</Description></PackagingType><Description>Rate Shopping&quot;
xmlstring1=xmlstring1&&quot;</Description><PackageWeight><Weight>33</Weight></PackageWeight>&quot;
xmlstring1=xmlstring1&&quot;</Package><ShipmentServiceOptions/></Shipment>&quot;
xmlstring1=xmlstring1&&quot;</RatingServiceSelectionRequest>&quot;
objxml.Open &quot;POST&quot;,&quot; objxml.Send xmlString&xmlString1
Response.Write objxml.responsetext

Set objxml = Nothing
%>
############################################################

&quot;xmlstring&quot; has the login details and &quot;xmlstring1&quot; has the package details for which we need the shipping information.

I am getting a &quot;Server.CreateObject Failed &quot; on the line &quot; objxml.Send xmlString&xmlString1&quot;.

Please help me out.What am i doing wrong?

Regards
Satish
 
It may not be liking the format of your request since it is not a valid xml document (it is two), you could try sending one after the other or embedding the access request inside the request.
Sorry I can't help more, but I don't have the UPS stuff to look at as a reference,
-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
This space has nothing in it, it's all ni your imagination
 
I dod try sending the two XML documents separately. i did this
###################################
<%
LINE 35----objxml.Send xmlString&crlf
LINE 36----objxml.Send xmlString1&crlf
%>
###################################

But now my error is this:

MSXML3.DLL error '80004005'

Unspecified error

/IISSamples/inters/test.asp, line 36

Any ideas? I am getting desperate.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top