Solved

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

Posted on 2011-03-11
3
1,603 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

New Relic recently released its Synthetics product that allows for the creation of performance monitors that periodically test a site's performance. If you wish to test an interactive workflow New Relic employs Selenium WebDriverJS to run those test…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

758 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

22 Experts available now in Live!

Get 1:1 Help Now