VBscript/MS SOAP Toolkit 3.0 Issues Invoking ACL-enabled Web Service

We have a web service with Execute ACL set to a particular group. We have created an access-controlled SOAP processor wrapper per Chapter 7 (pg. 80) of the webMethods SOAP Developer’s Guide. We are trying to initialize the service with the following VBscript code:

Dim soapClient as object = createobject(“MSSoap.SoapClient30”)
soapClient.ClientProperty(“ServerHTTPRequest”)=True
soapClient.mssoapinit(“[URL=“http://155.777.88.16:6666/WERCS”][COLOR=#0000ff]http://155.777.88.16:6666/WERCS[/color][/URL]”)
soapClient.ConnectorProperty(“AuthName”) = “user”
soapClient.ConnectorProperty(“AuthPassword”) = “pwd”
soapClient.send(sXML)

where “WERCS” is the processor’s process directive.

I realize that our syntax must be incorrect and that we are missing something. I came across a post on another site where an XML file is being passed in the init line like soapClient.mssoapinit(“[URL=“http://155.777.88.16:6666/WERCS/process.xml”][COLOR=#0000ff]http://155.777.88.16:6666/WERCS/process.xml[/color][/URL]”).

Anyway, at this point we receive the following error:

WSDLReader:XML Parser failed at linenumber 0, lineposition 0, reason is: The download of the specified resource has failed.
HRESULT=0x1: Incorrect function.
- WSDLReader:Loading of the WSDL file failed HRESULT=0x80070057: The parameter is incorrect.
- Client:One of the parameters supplied is invalid. HRESULT=0x80070057: The parameter is incorrect.

Calling the original web service with Anonymous access set with the following code works as expected:

Dim soapClient as object = createobject(“MSSoap.SoapClient30”)
soapClient.ClientProperty(“ServerHTTPRequest”)=True
soapClient.mssoapinit(“[URL=“http://155.777.88.16/WERCS_Main.wsdl”][COLOR=#0000ff]http://155.777.88.16/WERCS_Main.wsdl[/color][/URL]”)
soapClient.Main(sXML)

Any insight would be greatly appreciated. Thanks!

-Chris-

There a couple of articles out on advantage that discuss this issue. I believe it is the same issue you are facing. Here is a link to one.

It has to do with the way .Net does basic authentication, you will probably need to modified your vb script. The sample above is C#. I’ve used the C# example and it will work.

You could also embedded the authorization in the soap header and use your custom soap processor to handle it.

Hi Mark,

Thanks for the reply. Even though I am using VBscript and not .NET I would need to apply a variation of the C# sample syntax?

Also, I was wondering if my approach to this authentication issue is valid. We have created a web service connector with a “process directive” of “WERCS” and are trying to initialize it. Aside from the syntax in the C# sample, does the syntax look correct?

Thanks!

-Chris-

The directive name really doesn’t matter as long as you register it and it doesn’t conflict with something in already in use. Use the soap.processor:list command to make sure it’s registered properly. Can’t help you on the vbscript syntax.

Not a web service connector you mean a soap processor within webMethods to handle the security? Web service connector is for accessing web services not providing them.

Yes, sorry, meant soap processor.

The C# example that Mark G linked is quite dated and I would expect MS to have corrected the defect in which the PreAuthenticate property was ignored. At any rate, you need to set preauthenticate=true using the correct syntax for your language.

I could not tell from your message whether the URL was intended to be the IS soap processor or not. If “WERCS” is the directive for your custom soap processor then the URL for the endpoint would be: http://host:port/soap/WERCS.

Also, a web services connector has nothing whatsoever to do with allowing external clients to consume web services provided by IS. The WSC is just a wizard that generates Flow to consume one or more web service operations hosted elsewhere.

HTH,

Mark

Hi Mark,

Yes, the URL is intended to point to the soap processor. Unfortunately, I could not find any info on setting a “PreAuthentication” property for Microsoft’s SOAP Toolkit. I assume this would also be set through the “ConnectorProperty” mechanism. I did find a “WinHTTPAuthScheme” setting but this would be set after I initialize the soap client where I get the previous "download of the specified resource has failed" error. Maybe I am doing things backward…

Would you happen to have any sample code you could post that could shed some light and help me on my way? The code below is as far as I have gotten with the soap processor and it fails on the 3rd line when itializing it:

Dim soapClient as object = createobject(“MSSoap.SoapClient30”)
soapClient.ClientProperty(“ServerHTTPRequest”)=True
soapClient.mssoapinit(“[URL=“http://155.777.88.16:6666/soap/WERCS”][COLOR=#0000ff]http://155.777.88.16:6666/soap/WERCS[/color][/URL]”)
soapClient.ConnectorProperty(“AuthName”) = “user”
soapClient.ConnectorProperty(“AuthPassword”) = “pwd”

soapClient.ConnectorProperty(“WinHTTPAuthScheme”) = “1”
soapClient.send(sXML)

Thanks for you guidance.

-Chris-

Not sure what the soapClient.mssoapinit does or what input parameter it is expecting. If it is attempting to initialize a soap call from a WSDL file located at the supplies URL, then giving it the URL of the custom soap processor will not work.

You would need to create a WSDL and host it in some IS package’s pub folder (setting the .access file as needed to allow access to this static file).

Mark