web service beginners question

Discussion in 'ASP .Net' started by Mike P, Aug 18, 2004.

  1. Mike P

    Mike P Guest

    I have seen examples of web services where a particular method returns a
    single value, a string or an integer usually. I need to be able to
    return 1 or more values (depending upon what an SQL query returns). If
    I write a method in my web service that returns an ArrayList or array,
    will the XML that is returned by the web service deal with this
    appropriately (i.e. put each element in the array in a separate tag)?


    Cheers,

    Mike



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Mike P, Aug 18, 2004
    #1
    1. Advertising

  2. how about returning a dataset. a dataset is the only serializeable,
    remoteable object.

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
    Got tidbits? Get it here... http://tinyurl.com/27cok
    "Mike P" <> wrote in message
    news:%...
    >I have seen examples of web services where a particular method returns a
    > single value, a string or an integer usually. I need to be able to
    > return 1 or more values (depending upon what an SQL query returns). If
    > I write a method in my web service that returns an ArrayList or array,
    > will the XML that is returned by the web service deal with this
    > appropriately (i.e. put each element in the array in a separate tag)?
    >
    >
    > Cheers,
    >
    > Mike
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Alvin Bruney [MVP], Aug 18, 2004
    #2
    1. Advertising

  3. Mike P

    Mike P Guest

    Alvin,

    Yes, I'd think that returning a dataset would be the best option.

    I'm currently reading data from an XML file using XPathNavigator and
    XPathNodeIterator to select the subset of data that I want. I've never
    using the XPath objects before so I'm not sure how to get this data into
    a dataset.

    XPathDocument doc = new
    XPathDocument(@"C:\inetpub\wwwroot\test\test.xml");
    XPathNavigator nav = doc.CreateNavigator();
    XPathNodeIterator iter =
    nav.Select("/test/translation/engword[preceding-sibling::fraword = '" +
    strFraWord + "']");

    Can anybody help me out with this?


    Cheers,

    Mike



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Mike P, Aug 19, 2004
    #3
  4. Mike,

    Any data at all may be sent via a web service.

    The only requirement is that the object you are sending has to utilize the
    iSerializable interface. The ArrayList object does so, so that is one you
    can use as is.

    You may also build your own classes which utilize iSerializable.


    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche
    "Mike P" <> wrote in message
    news:%...
    >I have seen examples of web services where a particular method returns a
    > single value, a string or an integer usually. I need to be able to
    > return 1 or more values (depending upon what an SQL query returns). If
    > I write a method in my web service that returns an ArrayList or array,
    > will the XML that is returned by the web service deal with this
    > appropriately (i.e. put each element in the array in a separate tag)?
    >
    >
    > Cheers,
    >
    > Mike
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    S. Justin Gengo, Sep 21, 2004
    #4
    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. Roger stevenson

    Beginners Question Regarding Static Web Pages

    Roger stevenson, Apr 30, 2005, in forum: ASP .Net
    Replies:
    8
    Views:
    420
    Sam Samnah
    Jul 1, 2005
  2. hocho888
    Replies:
    1
    Views:
    679
  3. Michael Averstegge
    Replies:
    0
    Views:
    4,321
    Michael Averstegge
    Jan 10, 2006
  4. WTH
    Replies:
    1
    Views:
    177
  5. Leo Violette
    Replies:
    0
    Views:
    1,099
    Leo Violette
    Apr 17, 2009
Loading...

Share This Page