Hello Carrzkiss,
Unfortunately I must use classic ASP and our objective is to consume the web service.
Main Topics
Browse All TopicsHello,
I have a web service that I am attempting to connect to.
The web service is a CAPTCHA web service: http://en.wikipedia.org/wi
The problem I am having is that I need to consume this webservice using a classic ASP page and I am not 100% sure how to do it:
Here is what needs to happen:
1. Connect to web service and display image
2. Enter the text displayed in the image in a form field
3. Pass the text back to the web service and validate
4. Post the entire form to another page
I've included an example of the web service.
Any assistance with this would be greatly appreciated!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I do not think that you understood what I wrote.
So, lets try once again OK?
I do not think that the script that you are using will work with "Classic ASP"
SO. With that said.
The link that I provided above and will provide here
Is tested by me to work great
http://www.planet-source-c
If you need to implement a CAPTCHA into your site, this is the easiest one to use.
(I use Classic ASP As well, and will never tell someone to move over to .NET,
Reason: I do not know how to use .NET, and I think that is what your script is for is .NET
Usually .NET is presented with Colon </s:sequence> )
Good Luck
Carrzkiss
I think the issue is related to web service I am calling.
The following code works when calling a different web service:
==========================
Add this code to a separate include file:
<%
'option explicit
class WebService
public Url
public Method
public Response
public Parameters
public function execute()
dim xmlhttp
'old version of XML parser
Set xmlhttp = CreateObject("Microsoft.XM
'Set xmlhttp = CreateObject("Msxml2.DOMDo
'Added the xmlhttp.setProperty "ServerHTTPRequest", true below
'xmlhttp.setProperty "ServerHTTPRequest", true
xmlhttp.open "POST", Url & "/" & Method, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-ur
xmlhttp.send Parameters.toString
response = xmlhttp.responseText
set xmlhttp = nothing
end function
Private Sub Class_Initialize()
Set Parameters = new wsParameters
End Sub
Private Sub Class_Terminate()
Set Parameters = Nothing
End Sub
End class
''''''''''''''''''''''''''
class wsParameters
public mCol
public function toString()
dim nItem
dim buffer
buffer = ""
for nItem = 1 to Count
buffer = buffer & Item(nItem).toString & "&"
next
if right(buffer,1)="&" then
buffer = left(buffer,len(buffer)-1)
end if
toString = buffer
end function
public sub Clear
set mcol = nothing
Set mCol = CreateObject("Scripting.Di
end sub
public sub Add(pKey,pValue)
dim newParameter
set newParameter = new wsParameter
newParameter.Key = pKey
newParameter.Value = pValue
mCol.Add mCol.count+1, newParameter
set newParameter = nothing
end sub
public function Item(nKey)
set Item=mCol.Item(nKey)
end function
public function ExistsXKey(pKey)
dim nItem
for nItem = 1 to mcol.count
if mCol.Item(nItem).key = pKey then
ExistsXKeyword = true
exit for
end if
next
end function
public sub Remove(nKey)
mCol.Remove(nKey)
end sub
public function Count()
Count=mCol.count
end function
Private Sub Class_Initialize()
Set mCol = CreateObject("Scripting.Di
End Sub
Private Sub Class_Terminate()
Set mCol = Nothing
End Sub
end class
class wsParameter
public Key
public Value
public function toString()
toString = Key & "=" & Value
end function
end class
%>
==========================
Then add this code to the page that needs to use the web service (example):
<!--#include file="webservice-class.asp
<%
dim myemp
myemp = request.form("empid")
%>
<html>
<head>
<title>testws</title>
</head>
<body>
<form method="post" action="captcha.asp">
<input type="text" name="empid" />
<input type="submit" value="web service"/>
</form>
<%
dim ws
set ws = new webservice
'ws.url = "http://localhost/yourwebs
ws.method = "MethodName"
ws.parameters.Add "something", myemp
'ws.parameters.Add "ParamName2",300
'ws.parameters.Add "ParamNameN",500
if myemp <> "" then
ws.execute
response.Write ws.response
set ws = nothing
else
response.write "Enter something"
end if
%>
</body>
</html>
==========================
Business Accounts
Answer for Membership
by: carrzkissPosted on 2009-06-02 at 11:55:53ID: 24530151
I do not think this is going to work with Classic ASP. (Would have to see the resource about this script to be more sure about it)
ode.com/vb /scripts/S howCode.as p? txtCodeI d=9151&lng WId=4
If you want to use the CAPTCHA, then may I suggest.
http://www.planet-source-c
I have tested and used it, and am going to implement this very script into a commercial application
That I am working on now.
Highly recommend it, very simple to use, and works right out of the box.
Good Luck
Carrzkiss