Monday, March 26, 2012

web service beginners question

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!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" <mrp@.telcoelectronics.co.uk> wrote in message
news:%23a8qSZShEHA.1972@.TK2MSFTNGP09.phx.gbl...
>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,

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!

0 comments:

Post a Comment