Link to home
Start Free TrialLog in
Avatar of citadelind
citadelindFlag for India

asked on

Stamps.com Web Services, Asp.net, .net

Below code i have tried and found but i am not able to get further code on the same for api integration on Stamps.com Web Services i am using following file swsimv12.wsdl .

Question is how to get rates of shipping i need some sample code or some help on this side i tried but not working at all.

Dim request As New RateV5
request.FromZIPCode = ""
request.ToZIPCode = ""
request.WeightLb = ""
request.PackageType = PackageTypeV3.Package
request.Amount = "1.00"
request.ServiceType = ServiceType.USPM

Dim reply As StampRateServices.SwsimV12
Avatar of citadelind
citadelind
Flag of India image

ASKER

I am getting this error please check your self.


soap:ServerThere was an exception running the extensions specified in the config file. ---> Root element is missing.


XML Code is as below please guide us on this error code and if possible please send us back what to update on this code.

strXML = "<?xml version='1.0' encoding='utf-8'?>"
strXML += "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
strXML += "<soap:Body>"
strXML += "<tns:GetRates>"
strXML += "<tns:Authenticator>test</tns:Authenticator>"
strXML += "<tns:Rate>"
strXML += "<tns:FromZIPCode>90405</tns:FromZIPCode>"
strXML += "<tns:ToZIPCode>92111</tns:ToZIPCode>"
strXML += "<tns:WeightLb>12</tns:WeightLb>"
strXML += "<tns:PackageType>Package</tns:PackageType>"
strXML += "<tns:ShipDate>2009-08-31</tns:ShipDate>"
strXML += "<tns:InsuredValue>100.00</tns:InsuredValue>"
strXML += "</tns:Rate>"
strXML += "</tns:GetRates>"
strXML += "</soap:Body>"
strXML += "</soap:Envelope>"
strXMLhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlObj.loadXML(strXML)



strXMLhttp.Open("POST", "https://swsim.testing.stamps.com/swsim/SwsimV12.asmx", False)
strXMLhttp.setRequestHeader("SOAPAction", "http://stamps.com/xml/namespace/2010/11/swsim/swsimv12/GetRates")
strXMLhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8")
strXMLhttp.send(xmlObj.xml)

Dim strXMLResponse
Dim mydoc
Dim strChosen
'the response from Stamp
strXMLResponse = strXMLhttp.responseText
mydoc = Server.CreateObject("Microsoft.xmlDOM")
mydoc.loadxml(strXMLResponse)

Response.Write(strXMLResponse)
sorry wrong post
ASKER CERTIFIED SOLUTION
Avatar of Mlanda T
Mlanda T
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial