Consuming .NET Webservice from classic ASP

Discussion in 'ASP General' started by arnomarga@yahoo.com, Oct 24, 2008.

  1. Guest

    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
    , Oct 24, 2008
    #1
    1. Advertising

  2. wrote:
    > 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.

    --
    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"
    Bob Barrows [MVP], Oct 25, 2008
    #2
    1. Advertising

  3. keyser soze Guest

    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

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

    <> escribió en el mensaje
    news:...
    | 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
    keyser soze, Oct 30, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. alok
    Replies:
    1
    Views:
    592
    Danno
    Dec 26, 2005
  2. pankajgharge

    Consuming Web Service in Classic ASP

    pankajgharge, Apr 17, 2009, in forum: .NET
    Replies:
    0
    Views:
    1,681
    pankajgharge
    Apr 17, 2009
  3. Steve Kuhn
    Replies:
    2
    Views:
    348
    majiofpersia
    Jul 29, 2003
  4. Ghislain Tanguay

    Execution time consuming the same Webservice Vb6 vs VB.Net

    Ghislain Tanguay, Jul 29, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    150
    Ghislain Tanguay
    Jul 29, 2004
  5. Replies:
    3
    Views:
    270
    Anthony Jones
    Sep 5, 2008
Loading...

Share This Page