|
-
Feb 5th, 2010, 07:39 PM
#1
Thread Starter
New Member
New to WSDL and need direction
Hello all. I am embarking on a work project to try to make everyone in my office a little bit happier. Right now we need travel rates between 2 zip codes, we have to go to a website, enter a csv file with all details (origin, destination, date, etc.) and it will return the same csv file with a rate amended. The problem with this method is that it is not efficient for large volumes of inquiries.
I did some digging and discovered in the user manual that it is possible for users to develop an interface to the service. The manual includes a WSDL address, that I can't link to here for confidentiality reasons, and also gives the base XML behind most of the web methods.
Right now I am trying to get the simplest of the methods to work. The system
performs authentication for every service request received. This requires the service consumer to pass an authentication token within the SOAP Header. I am not sure how to use this, but here is the XML behind it.
Code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.***.com">
<soapenv:Header>
<web:AuthenticationToken>
<web:licenseKey>licensekey</web:licenseKey>
<web:password>password</web:password>
<web:username>username</web:username>
</web:AuthenticationToken>
</soapenv:Header>
<soapenv:Body>
</soapenv:Body>
</soapenv:Envelope>
The first thing that I am trying to get to work is a method named isReady that takes in no arguments and returns a boolean. This service is used to determine if the web service is accepting rating requests.
XML for the input:
Code:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:web="http://webservices.***.com">
<soapenv:Header>
<web:AuthenticationToken>
<web:licenseKey> string </web:licenseKey>
<web:password> string </web:password>
<web:username> string </web:username>
</web:AuthenticationToken>
</soapenv:Header>
<soapenv:Body>
<web:isReady/>
</soapenv:Body>
</soapenv:Envelope>
XML for the output:
Code:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<ns1:isReadyResponse xmlns:ns1="http://webservices.***.com">
<ns1:out> boolean </ns1:out>
</ns1:isReadyResponse>
</soap:Body>
</soap:Envelope>
This is what i tried to use in Access's VBA.
Code:
Public Sub GetXML()
Dim objSClient As MSSOAPLib.SoapClient
Dim oXML As MSXML2.DOMDocument40
Dim rst As New ADODB.Recordset
Dim str As New ADODB.Stream
Set objSClient = New SoapClient
Set oXML = New DOMDocument40
objSClient.mssoapinit "http://applications.***.com/AdminManager/services/**********?wsdl"
oXML.loadXML (objSClient.isReady())
str.Open
oXML.Save str
str.Position = 0
rst.Open str
Set oXML = Nothing
Set objSClient = Nothing
Set rst = Nothing
Set Stream = Nothing
End Sub
Whenever I try that, I end up with an error that says:
Run Time error '-2147467259 (80004005)':
Request must include a custom header and a AuthenticationToken.
Please see your user's guide for details: <soapenv:Header>
<web:AuthenticationToken><web:lisenceKey>??????</web:lisenceKey> <web:username>??????</web:username></web:AuthenticationToken>
</soapenv:Header>
Can anyone out there please point me in the right direction?
-
Feb 6th, 2010, 12:44 PM
#2
Re: New to WSDL and need direction
Have you tried to use something Webservices Studio to test if the webservice is working?
This tool also gives you a sample request & sample response.
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Feb 8th, 2010, 09:56 AM
#3
Thread Starter
New Member
Re: New to WSDL and need direction
I just downloaded it, and I will mess around with WebServicesStudio for a couple hours today.
-
Feb 8th, 2010, 10:03 AM
#4
Re: New to WSDL and need direction
 Originally Posted by superrobb420
I just downloaded it, and I will mess around with WebServicesStudio for a couple hours today.
This is what I had done in an earlier project when I had to call a webservice from my VB 6 code.
I wrote a .NET component to call the webservice.
Then I built a COM Wrapper around it.
I referenced this COM component in my VB 6 code as an activeX dll.
Then was able to complete the call.
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|