Solved

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

Posted on 2011-03-11
3
1,617 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:citadelind
  • 2
3 Comments
 

Author Comment

by:citadelind
ID: 35109651
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)
0
 

Author Comment

by:citadelind
ID: 35109692
sorry wrong post
0
 
LVL 30

Accepted Solution

by:
MlandaT earned 500 total points
ID: 35278124
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 new StampRateServices.SwsimV12
reply.url = "https://swsim.testing.stamps.com/swsim/SwsimV12.asmx"

dim data as object = reply.GetRates(request) 'I hav euse dobject here because I dont know what return type the GetRates method will give.

Open in new window



- cannot test this code against the web service provided. I believe it requires some authentication of sorts...???
- can you maybe try this link: https://swsim.testing.stamps.com/swsim/SwsimV12.asmx?wsdl  .... does it return any XML data? That is the WSDL whcih describes the web services methods and return types etc
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
These instructions are based on installing Owncloud on your new raspberry pi connected with a usb HDD. What do you need Part A? A Raspberry Pi, model B. A boot SD card for the Raspberry Pi. A usb HDD An Ethernet cable to connect to the lo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now