Calling an ASP.NET web service from ASP

Discussion in 'ASP .Net Web Services' started by Burak, Nov 15, 2004.

  1. Burak

    Burak Guest

    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
    Burak, Nov 15, 2004
    #1
    1. Advertising

  2. Burak

    Dan Rogers Guest

    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
    --------------------
    >From: (Burak)
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >Subject: Calling an ASP.NET web service from ASP
    >Date: 15 Nov 2004 13:43:04 -0800
    >Organization: http://groups.google.com
    >Lines: 44
    >Message-ID: <>
    >NNTP-Posting-Host: 66.95.33.2
    >Content-Type: text/plain; charset=ISO-8859-1
    >Content-Transfer-Encoding: 8bit
    >X-Trace: posting.google.com 1100554984 17455 127.0.0.1 (15 Nov 2004

    21:43:04 GMT)
    >X-Complaints-To:
    >NNTP-Posting-Date: Mon, 15 Nov 2004 21:43:04 +0000 (UTC)
    >Path:

    cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwi
    x.com!newsfeed.cwix.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news
    glorb.com!postnews.google.com!not-for-mail
    >Xref: cpmsftngxa10.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webservices:26545
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >
    >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
    >
    Dan Rogers, Nov 15, 2004
    #2
    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. hocho888
    Replies:
    1
    Views:
    605
  2. Michael Averstegge
    Replies:
    0
    Views:
    4,198
    Michael Averstegge
    Jan 10, 2006
  3. Replies:
    1
    Views:
    223
    Joe Kaplan \(MVP - ADSI\)
    Jun 14, 2006
  4. JC

    Calling a web service from a web service

    JC, Aug 16, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    114
    Tom Vande Stouwe MCSD.net
    Aug 20, 2003
  5. Mr. x

    calling web-service from another web-service

    Mr. x, Sep 29, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    112
    Mr. x
    Sep 29, 2003
Loading...

Share This Page