views:

159

answers:

2

I'm trying to find a way to access a web service from a VB Script .vbs file running under wscript.exe. I pulled some sample code from Microsoft and modified it to use the SOAP 3.0 toolkit but it gives me an error.

Dim SOAPClient
Set SOAPClient = createobject("MSSOAP.SOAPClient30")
SOAPClient.mssoapinit("https://www.domain.com/Folder/Service.asmx?WSDL")

On that last line I get an error message:

WSDLReader: Could not find '/definitions' inside the default WSDL namespace HRESULT=0x80004005: Unspecified error - WSDLReader:Loading of the WSDL file failed HRESULT=0x80004005: Unspecified error - Client:One of the parameters supplied is invalid. HRESULT=0x80070057: The parameter is incorrect.

The reason it needs to be in VB Script is because it's going to be used in a program over which I have no control and that program only supports VB Script. Is there a way to get VB Script to be able to parse a newer WSDL file?

I do have the source code for the web service though I didn't write it myself. Is there something I can change in the web service to make it schema compatible with the SOAP toolkit 3.0? I can use this web service from a .Net app with no trouble at all.

+1  A: 

Why not writing a managed component that will consume the web service and expose it as COM component which your script might consume?

Darin Dimitrov
Only because this was supposed to be a quickie solution to a problem, not a major development effort. I agree that is a viable workaround. I know that wouldn't take too long but it would take longer that writing a quick vb script. If we can't get the script working with the web service then I'll see if my client wants me to take the time to write a "bridge" for the script to use.
Steve Hiner
A: 

Check in the <webServices><protocols> section of the web.config for your service to see whether it is supporting SOAP 1.1 or 1.2. The SOAP Toolkit predates SOAP 1.2 and may not understand it.

John Saunders