Consuming .NET Webservice from classic ASP


A

arnomarga

I am trying to consuming a .NET web service from a standard (classic)
ASP, but having not so much luck as I dont have much experience about
SOAP.

Here is the webservice url: http://test.webservices.superbreak.com/SoapEndpoint.asmx

I have been advised that i need to use this through MSSOAP Toolkit or
through soap envelope.

Could someone advise about some coding pattern to access this service?

Thanks!

arno
 
Ad

Advertisements

B

Bob Barrows [MVP]

I am trying to consuming a .NET web service from a standard (classic)
ASP, but having not so much luck as I dont have much experience about
SOAP.

Here is the webservice url:
http://test.webservices.superbreak.com/SoapEndpoint.asmx

I have been advised that i need to use this through MSSOAP Toolkit or
through soap envelope.

Could someone advise about some coding pattern to access this service?
Plug your subject line into google - you will see several articles from
4guysfromRolla about this.
 
Ad

Advertisements

K

keyser soze

Hope this help
--------------------------

first of nothing
capture the packets and see inside (whith a windows cd tool)
or for example Ip-Tools

once you know the pattern (the SOAP message)
you will able to put the data in its right place
in the next code, assign your pattern to the "txt" variable

for example the Soap message that i consume is:
<?xml version=""1.0"" encoding=""UTF-8"" standalone=""no""?>
<SOAP-ENV:Envelope
xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAPSDK1="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
<SOAP-ENV:Body
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAPSDK1:getSessionInfo xmlns:SOAPSDK1="http://webservices.myService">
<hash>JJEHEII</hash>
</SOAPSDK1:getSessionInfo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

the capture is the hard part
but when you have the soap message,
you can sure that will no problems
(this works for any webservice .net, or others)

KS
--------------------------

function GetSessionInfo(hash)
dim txt

txt= "<?xml version=""1.0"" encoding=""UTF-8"" standalone=""no""?><SOAP-ENV:Envelope
xmlns:SOAPSDK1=""http://www.w3.org/2001/XMLSchema""
xmlns:SOAPSDK1=""http://www.w3.org/2001/XMLSchema-instance""
xmlns:SOAPSDK1=""http://schemas.xmlsoap.org/soap/encoding/""
xmlns:SOAP-ENV=""http://schemas.xmlsoap.org/soap/envelope/""><SOAP-ENV:Body
SOAP-ENV:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""><SOAPSDK4:getSessionI
nfo xmlns:SOAPSDK1=""http://webservice.myService""><hash>" &_
hash &_
"</hash></SOAPSDK1:getSessionInfo></SOAP-ENV:Body></SOAP-ENV:Envelope>"

dim wsuri, ohttp, node, odom
wsuri = "http://x.x.x.x:8080/axis/services/SessionPool"
Set ohttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
ohttp.Open "POST", wsuri, False
ohttp.setRequestHeader "Man", "POST " & wsuri & " HTTP/1.1"
ohttp.setRequestHeader "Host", "x.x.x.x:8080"
ohttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
ohttp.setRequestHeader "SOAPAction", "getSessionInfo"
ohttp.send(txt)

Set odom =Server.CreateObject("MSXML2.DOMDocument")
odom.loadxml( ohttp.responseText )
odom.loadxml( odom.lastChild.text )

dim ret_id, ret_tipo
ret_id= odom.firstChild.firstChild.text
ret_tipo= odom.firstChild.lastChild.text

GetSessionInfo= ret_id

Set ohttp = Nothing
Set odom = Nothing
end function

--------------------------

<[email protected]> escribió en el mensaje
| I am trying to consuming a .NET web service from a standard (classic)
| ASP, but having not so much luck as I dont have much experience about
| SOAP.
|
| Here is the webservice url: http://test.webservices.superbreak.com/SoapEndpoint.asmx
|
| I have been advised that i need to use this through MSSOAP Toolkit or
| through soap envelope.
|
| Could someone advise about some coding pattern to access this service?
|
| Thanks!
|
| arno
|
|
| ---
| avast! Antivirus: Inbound message clean.
| Virus Database (VPS): 081029-0, 29/10/2008
| Tested on: 30/10/2008 11:06:37 a.m.
| avast! - copyright (c) 1988-2008 ALWIL Software.
| http://www.avast.com
|
|
|



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 081029-0, 29/10/2008
Tested on: 30/10/2008 11:23:36 a.m.
avast! - copyright (c) 1988-2008 ALWIL Software.
http://www.avast.com
 

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

Top