Webservice that returns an xml document instead of an array

Discussion in 'ASP .Net' started by Pim75, Mar 21, 2007.

  1. Pim75

    Pim75 Guest

    Hello,

    I've written a webservice that returns an array. The output of the
    webservice has to be consumed by a classic asp application.

    As classic asp can't read the returned array I want the webservice to
    return a xml document instead of the array.

    Can anyone tell me how I can output the array as a xml document?

    The webservice looks as follows:
    Public Function GetModellen() As Array
    Dim ps As New TestSoap.Externalservice
    Dim strArray() As TestSoap.TAutoModel
    strArray = ps.GetModellen()

    Return strArray
    End Function

    The array output from the webservice at this moment is:
    <?xml version="1.0" encoding="utf-8"?>
    <ArrayOfTAutoModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-
    instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://
    tempuri.org/">
    <TAutoModel>
    <ModelId>33</ModelId>
    <Omschrijving>200</Omschrijving>
    <Beginjaar>1984</Beginjaar>
    </TAutoModel>
    </ArrayOfTAutoModel>

    Thanks in advance for your help!
     
    Pim75, Mar 21, 2007
    #1
    1. Advertising

  2. You probably do not have to jump through these hoops, as you will be using
    the SOAP toolkit on the backside. You should be able to pull the XML
    returned for the array without changing the service, as the ASP side will
    only see SOAP.

    If you must switch it, it is easy enough so make a routine that creates the
    XML document and streams it back. There is no automagic way I know of, other
    than slapping the data into a DataSet instead and saving it off as XML.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    *********************************************
    Think outside the box!
    *********************************************
    "Pim75" <> wrote in message
    news:...
    > Hello,
    >
    > I've written a webservice that returns an array. The output of the
    > webservice has to be consumed by a classic asp application.
    >
    > As classic asp can't read the returned array I want the webservice to
    > return a xml document instead of the array.
    >
    > Can anyone tell me how I can output the array as a xml document?
    >
    > The webservice looks as follows:
    > Public Function GetModellen() As Array
    > Dim ps As New TestSoap.Externalservice
    > Dim strArray() As TestSoap.TAutoModel
    > strArray = ps.GetModellen()
    >
    > Return strArray
    > End Function
    >
    > The array output from the webservice at this moment is:
    > <?xml version="1.0" encoding="utf-8"?>
    > <ArrayOfTAutoModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-
    > instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://
    > tempuri.org/">
    > <TAutoModel>
    > <ModelId>33</ModelId>
    > <Omschrijving>200</Omschrijving>
    > <Beginjaar>1984</Beginjaar>
    > </TAutoModel>
    > </ArrayOfTAutoModel>
    >
    > Thanks in advance for your help!
    >
     
    Cowboy \(Gregory A. Beamer\), Mar 21, 2007
    #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. Ben Turner
    Replies:
    2
    Views:
    9,192
    Ken Cox [Microsoft MVP]
    Jan 2, 2004
  2. Mike
    Replies:
    0
    Views:
    8,108
  3. Tony Prichard
    Replies:
    0
    Views:
    751
    Tony Prichard
    Dec 12, 2003
  4. Manish Hatwalne
    Replies:
    1
    Views:
    404
    Martin Honnen
    Jul 13, 2004
  5. Srijayanth Sridhar
    Replies:
    19
    Views:
    639
    David A. Black
    Jul 2, 2008
Loading...

Share This Page