469,350 Members | 1,829 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,350 developers. It's quick & easy.

Consuming Soap 3.0 Web Services from ASP

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>

Jul 22 '05 #1
2 9189
mkosca01 wrote:
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.

I've never done this, so all I can suggest is to Google for these error
numbers and include the SOAB keyword in the search.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #2
>I've never done this, so all I can suggest is to >Google for these error
numbers and include the SOAB keyword in the search.


Thanks Bob. I've already had a browse around the web. It appears as if
SOAP 3.0 works best with ASP.NET and not so well with classic ASP.

I think that SOAP 2.0 would do the trick but it look like Microsoft is no
longer offering this toolkit for download.

So it look like I may have to pick up some books and write the plumbing
etc.. from scratch.

Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jamie Phillips | last post: by
1 post views Thread by leslie_tighe | last post: by
3 posts views Thread by Jeremy Chapman | last post: by
1 post views Thread by Thomas Mueller | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.