Calling an ASP.NET web service from ASP

B

Burak

Hello,

When I call an asp.net web service that returns a string from
an asp page, it works fine, but when I call an asp.net web service
that returns a class, it does not work.

How can I call an asp.net web service that returns a complex type
from an asp page?

Thank you,

Burak

I included my code below

Dim SoapClient
set SoapClient = Server.CreateObject("MSSOAP.SoapClient30")

SoapClient.ClientProperty("ServerHTTPRequest") = True
SoapClient.mssoapinit
"http://maps.servicelocator.org/AddressBrokerService/ABService.asmx?
wsdl", "ABService", "ABServiceSoap"

Dim xml
Set xml = Server.CreateObject("MSXML2.DOMDocument")

Dim addr, city, state
addr = "1941 Roland Clarke Place"
city = "Reston"
state = "VA"
zipcode = "20191"

Dim xmlSTR
xmlSTR = SoapClient.GetGeocode(addr,city,state,zipcode)

xml.async = false
xml.loadXML(xmlSTR)

if xml.parseError.errorcode<>0 then
'error handling code
else
' proceed
xml.save(Server.mappath("data.xml"))
end if
 
D

Dan Rogers

Hi Burak,

To do this, you need to prepare the calling application for the response.
You didn't mention how you are making the calls. One option you have is to
obtain a copy of a SOAP based tool-kit from any number of sources, and
create application logic (perhaps in Visual Basic?) that consumes the
generated XML and returns COM classes. The SOAP Toolkit was such a tool.
Another option you have is to write code that captures the HTTP response
from a post (the DOM can do this) and then parse the response as XML.

Another option is to use Visual Studio .NET 2003 and build a class that
exposes a COM interface and that internally makes a web service call.

Best regards

Dan Rogers
Microsoft Corporation
--------------------
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top