Using classic ASP as a web service client

K

Keith E.

Does any one know of resources or can you offer direction
on how to use classic ASP as a web service client.

I have found all kinds of stuff for the ASP.NET

But, I need to be able tap into a web service from a ASP
3.0 as a client

I have webservice on a IIS platform w/ the SOAP 3.0 kit
installed and can talk to it via a VB 6 client.

I'd like to also connect to it via an ASP page.

Thank in advance for any help.

Keith E.
 
C

Chris Hohmann

Keith E. said:
Does any one know of resources or can you offer direction
on how to use classic ASP as a web service client.

I have found all kinds of stuff for the ASP.NET

But, I need to be able tap into a web service from a ASP
3.0 as a client

I have webservice on a IIS platform w/ the SOAP 3.0 kit
installed and can talk to it via a VB 6 client.

I'd like to also connect to it via an ASP page.

Thank in advance for any help.

Keith E.

http://www.4guysfromrolla.com/webtech/070302-1.shtml
 
K

Keith E.

Thanks for the tip. Now on to the glitch.

Just to keep things simple and get the maechnics going,
the webserver used for testing, just adds 2 numbers.

Here's the ASP page:

<%@ Language=VBScript %>
<html>
<head>
<title>Call AddServer Webservice</title>
<body>
<%
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Dim oSOAP
Set oSOAP = Server.CreateObject("MSSOAP.SoapClient")
oSOAP.ClientProperty("ServerHTTPRequest") = True
oSOAP.mssoapinit
("http://192.168.1.12/WebServices/AddServer.WSDL")
Response.write("Sum 0f " & Request.Form("Num1") & "
+ " & Request.Form("Num2") & " = " & oSOAP.Add(Request.Form
("Num1") ,Request.Form("Num2")) & "<BR>")
End If
Set oSOAP = nothing
%>
<FORM method=POST name="form1">
Enter The numbers to add.<BR>
<INPUT type="text" name="Num1">&nbsp; + &nbsp; <INPUT
type="text" name="Num2">
<BR><BR>
<INPUT type="submit" value="Add" name="submit1">
</form>
</body>
</html>


The

oSOAP.mssoapinit
("http://192.168.1.12/WebServices/AddServer.WSDL")

line fails and produces the following error

Server object, ASP 0177 (0x800401F3)
Invalid ProgID.

Any ideas?

Keith E.
 
C

Chris Hohmann

Keith E. said:
Thanks for the tip. Now on to the glitch.

Just to keep things simple and get the maechnics going,
the webserver used for testing, just adds 2 numbers.

Here's the ASP page:

<%@ Language=VBScript %>
<html>
<head>
<title>Call AddServer Webservice</title>
<body>
<%
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Dim oSOAP
Set oSOAP = Server.CreateObject("MSSOAP.SoapClient")
oSOAP.ClientProperty("ServerHTTPRequest") = True
oSOAP.mssoapinit
("http://192.168.1.12/WebServices/AddServer.WSDL")
Response.write("Sum 0f " & Request.Form("Num1") & "
+ " & Request.Form("Num2") & " = " & oSOAP.Add(Request.Form
("Num1") ,Request.Form("Num2")) & "<BR>")
End If
Set oSOAP = nothing
%>
<FORM method=POST name="form1">
Enter The numbers to add.<BR>
<INPUT type="text" name="Num1">&nbsp; + &nbsp; <INPUT
type="text" name="Num2">
<BR><BR>
<INPUT type="submit" value="Add" name="submit1">
</form>
</body>
</html>


The

oSOAP.mssoapinit
("http://192.168.1.12/WebServices/AddServer.WSDL")

line fails and produces the following error

Server object, ASP 0177 (0x800401F3)
Invalid ProgID.

Any ideas?

Keith E.

1. Do you have the SOAP SDK installed on the ASP (classic) web server?
2. Does the version correspond to the one upon which the web service is
deployed?
3. You did not specify a service name in the mssoapinit call. Is the
first service in the WSDL the one with the Add function?

-Chris Hohmann
 
G

Guest

1. Do you have the SOAP SDK installed on the ASP
(classic) web server?

Yes the SOAP SDK is installed on the ASP (classic) web
server. However, I am not sure the installation is OK.
When I try and run the WDSL Generator program, it gives
a "runtime error 339 MSCOMCT2.OCX or one of its
dependencies could not be found". Which may indicate all
the parts are not there for IIS as well. So, to generate
the WDSL file I ran the WDSL Generator on my local PC
machine rather than the server and hand edited the path to
the DLL that is the WebSevice. All this works when a VB
application is the client consumer of the Web Service. So,
I figure the WDSL and the WSML and the ASP and the Wgen
files are OK, since the service works with VB client.
2. Does the version correspond to the one upon which the
web service is deployed?

Yes the installation of the SOAP kit was a virgin install.
There were not previous versions of the SOAP kit on the
machine.
3. You did not specify a service name in the mssoapinit
call. Is the first service in the WSDL the one with the
Add function?

Not sure how I would specify a service name in
the "mssoapinit". Example?? The Add function is the only
funcion in the web service DLL. I kept things simple,
while I sorted out the mechanics.

Keith E.
 
K

Keith E.

Figured it out.

There is a sligh change in object names between the SOAP
2.0 kit and the SOAP 3.0 kit. The
http://www.4guysfromrolla.com/webtech/070302-1.shtml
uses 3.0. So, MSSOAP.SoapClient needs to be
MSSOAP.SoapClient30

The following code works.

<%@ Language=VBScript %>
<html>
<head>
<title>Call AddServer Webservice</title>
<body>
<%
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Dim oSOAP
Set oSOAP = Server.CreateObject("MSSOAP.SoapClient30")
oSOAP.ClientProperty("ServerHTTPRequest") = True
'Response.Write oSOAP.detail & "<br><br>"

oSOAP.mssoapinit "http://192.168.1.12/WebServices/AddServer
..WSDL","AddServer"
Response.write("Sum 0f " & Request.Form("Num1") & "
+ " & Request.Form("Num2") & " = " & oSOAP.Add(Request.Form
("Num1") ,Request.Form("Num2")) & "<BR>")
End If
Set oSOAP = nothing
%>
<FORM method=POST name="form1">
Enter The numbers to add.<BR>
<INPUT type="text" name="Num1">&nbsp; + &nbsp; <INPUT
type="text" name="Num2">
<BR><BR>
<INPUT type="submit" value="Add" name="submit1">
</form>
</body>
</html>
 
C

Chris Hohmann

Keith E. said:
Figured it out.

There is a sligh change in object names between the SOAP
2.0 kit and the SOAP 3.0 kit. The
http://www.4guysfromrolla.com/webtech/070302-1.shtml
uses 3.0. So, MSSOAP.SoapClient needs to be
MSSOAP.SoapClient30

The following code works.

<%@ Language=VBScript %>
<html>
<head>
<title>Call AddServer Webservice</title>
<body>
<%
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Dim oSOAP
Set oSOAP = Server.CreateObject("MSSOAP.SoapClient30")
oSOAP.ClientProperty("ServerHTTPRequest") = True
'Response.Write oSOAP.detail & "<br><br>"

oSOAP.mssoapinit "http://192.168.1.12/WebServices/AddServer
.WSDL","AddServer"
Response.write("Sum 0f " & Request.Form("Num1") & "
+ " & Request.Form("Num2") & " = " & oSOAP.Add(Request.Form
("Num1") ,Request.Form("Num2")) & "<BR>")
End If
Set oSOAP = nothing
%>
<FORM method=POST name="form1">
Enter The numbers to add.<BR>
<INPUT type="text" name="Num1">&nbsp; + &nbsp; <INPUT
type="text" name="Num2">
<BR><BR>
<INPUT type="submit" value="Add" name="submit1">
</form>
</body>
</html>

Glad you got it working. As you already figured out, the second
parameter of the mssoapinit method is the service name. As a general
note, Microsoft seems to be making a move to deprecate version
independent component calls as demonstrated both in this case and in the
case of MSXML 4.0. In the long run I feel this is a good thing, but in
the short term, it's worth being aware of.

HTH
-Chris Hohmann
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top