Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-03-11
3
Medium Priority
?
1,703 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 31

Accepted Solution

by:
MlandaT earned 2000 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Online collaboration is quickly becoming embedded in the workplace, and its benefits are tangible. See what the current landscape looks like and what the future holds for collaboration tools and the future of work.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

719 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