Hello,
I have recently downloaded and installed the Soap Toolkit 3.0 from
microsoft. I have successfully created the example web service DocSample1
and am able to run this from the command line using the following .vbs
file.
Option Explicit
Dim soapClient3
set soapclient3 = CreateObject("MSSOAP.SoapClient30")
On Error Resume Next
Call SoapClient3.mssoapinit("DocSample1.wsdl", "DocSample1",
"Sample1SoapPort")
if err <> 0 then
wscript.echo "initialization failed " + err.description
end if
wscript.echo SoapClient3.EchoString("Bob")
if err <> 0 then
wscript.echo err.description
wscript.echo "faultcode=" + SoapClient3.faultcode
wscript.echo "faultstring=" + SoapClient3.faultstring
wscript.echo "faultactor=" + SoapClient3.faultactor
wscript.echo "detail=" + SoapClient3.detail
end if
wscript.echo SoapClient3.AddNumbers(2, 3)
if err <> 0 then
wscript.echo err.description
wscript.echo "faultcode=" + SoapClient3.faultcode
wscript.echo "faultstring=" + SoapClient3.faultstring
wscript.echo "faultactor=" + SoapClient3.faultactor
wscript.echo "detail=" + SoapClient3.detail
end if
This correctly produces
Bob
5
The application root of IIS is C:\Inetpub\logidev most of our .asp scripts
are in C:\Inetpub\logidev\aspScripts and generally they are simple wrappers
that call COM objects.
The SOAP 3.0 application that I call with the .vbs script resides in
C:\Inetpub\logidev\SOAP
Any attempt to run the Web Service from a .asp page gives me
initialisation errors.
WSDLReader error '80020009'
WSDLReader:XML Parser failed at linenumber 0, lineposition 0, reason is:
The system cannot find the path specified. 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.
The .asp script I am using is listed below. I have cobbled it together
from various web sources.
Does anyone know how I can consume a Soap 3.0 web service from classic ASP
running W2K server.
Many thanks for any help you can provide.
<html>
<head>
<title>Calling a webservice from classic ASP, using the SOAP
Toolkit</title>
<body>
<%
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Dim oSOAP
Set oSOAP = Server.CreateObject("MSSOAP.SoapClient30")
oSOAP.ClientProperty("ServerHTTPRequest") = True
'oSOAP.mssoapinit("http://www.wimdows.net/webservices/temperature.asmx?wsdl")
'Response.write("Temperature in fahrenheit: " &
oSOAP.cels2fahr(CDbl(Request.Form("text1"))) & "<BR>")
'Call
oSOAP.MSSoapInit("http://localhost/SOAP/SampleDoc1/Client/DocSample1.asmx?wsdl",
"DocSample1", "Sample1SoapPort")
'Call
oSOAP.MSSoapInit("http://logiweb2/SOAP/SampleDoc1/Client/DocSample1.wsdl",
"DocSample1", "Sample1SoapPort")
'Call oSOAP.MSSoapInit("DocSample1.wsdl", "DocSample1",
"Sample1SoapPort", "")
'Call oSOAP.MSSoapInit("DocSample1.wsdl", "", "", "")
'Call oSOAP.MSSoapInit("/SOAP/SampleDoc1/Client/DocSample1.asmx?WDSL",
"", "", "")
Call
oSOAP.MSSoapInit("../SOAP/SampleDoc1/Client/DocSample1.asmx?wsdl",
"DocSample1", "Sample1SoapPort")
Response.Write oSOAP.EchoString("Bob")
If err <> 0 Then
Response.Write err.description
Response.Write "faultcode=" + SoapClient3.faultcode
Response.Write "faultstring=" + SoapClient3.faultstring
Response.Write "faultactor=" + SoapClient3.faultactor
Response.Write "detail=" + SoapClient3.detail
End If
Response.Write oSOAP.AddNumbers(322, 37)
If err <> 0 Then
Response.Write err.description
Response.Write "faultcode=" + SoapClient3.faultcode
Response.Write "faultstring=" + SoapClient3.faultstring
Response.Write "faultactor=" + SoapClient3.faultactor
Response.Write "detail=" + SoapClient3.detail
End If
End If
%>
<FORM method=POST name=”form1”>
Push button to make SOAP call<BR>
<INPUT type="submit" value="Convert" name=”submit1”>
</form>
</body>
</html>