Connecting Tech Pros Worldwide Forums | Help | Site Map

Consuming .NET Webservice from classic ASP

arnomarga@yahoo.com
Guest
 
Posts: n/a
#1: Oct 24 '08
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.c...pEndpoint.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

Bob Barrows [MVP]
Guest
 
Posts: n/a
#2: Oct 25 '08

re: Consuming .NET Webservice from classic ASP


arnomarga@yahoo.com wrote:
Quote:
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.c...pEndpoint.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.

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


keyser soze
Guest
 
Posts: n/a
#3: Oct 30 '08

re: Consuming .NET Webservice from classic ASP


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

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

<arnomarga@yahoo.comescribió en el mensaje
news:7391e305-d274-46a0-badd-6637b6cd314d@t54g2000hsg.googlegroups.com...
| 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.c...pEndpoint.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



Closed Thread