469,314 Members | 2,007 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Using classic ASP as a web service client

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.
Jul 19 '05 #1
6 25633
"Keith E." <ke*********@designforum.com> wrote in message
news:33****************************@phx.gbl...
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
Jul 19 '05 #2
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.
Jul 19 '05 #3
"Keith E." <ke*********@designforum.com> wrote in message
news:01****************************@phx.gbl...
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

Jul 19 '05 #4
>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.
Jul 19 '05 #5
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>

Jul 19 '05 #6
"Keith E." <ke*********@designforum.com> wrote in message
news:05****************************@phx.gbl...
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
Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Van Steenbergen Jan | last post: by
3 posts views Thread by Michael Hoehne | last post: by
5 posts views Thread by David Lozzi | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.