Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / May 2005

Tip: Looking for answers? Try searching our database.

Return Dataset?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fao, Sean - 25 May 2005 17:40 GMT
I'm relatively new to web services and I was wondering why, when authors
create a web service that queries a database, that they don't just
return the dataset object in the exposed method as in the following
fragment:

[WebMethod]
public System.Data.DataSet someQuery(string queryString)
{
  [...]

  return dataset;
}

What I usually see is that authors return a class, which describes the
structure of the results (like a table definition).

Is this just per convention or is there another explanation?

Thank you in advance,

Signature

Sean

RichardF - 25 May 2005 18:01 GMT
One explanation I can think of is that the DataSet is unique to .NET.

What if the user of your web service is not a .NET program?

If you want your web service to be easily used by non .NET users, then
you should avoid returning .NET specific objects.  They could write
code to parse the XML representaiton of the DataSet, but simpler
return types might be more appropriate.

RichardF

>I'm relatively new to web services and I was wondering why, when authors
>create a web service that queries a database, that they don't just
[quoted text clipped - 15 lines]
>
>Thank you in advance,
Fao, Sean - 26 May 2005 01:20 GMT
>>I'm relatively new to web services and I was wondering why, when authors
>>create a web service that queries a database, that they don't just
[quoted text clipped - 13 lines]
>>
>>Is this just per convention or is there another explanation?

> One explanation I can think of is that the DataSet is unique to .NET.
>
[quoted text clipped - 4 lines]
> code to parse the XML representation of the DataSet, but simpler
> return types might be more appropriate.

Doesn't the WSDL describe the data type?  I thought that was one of the
ideas behind SOAP.  That way, you can create your own data types and
everybody knows what they are.

Signature

Sean

Fao, Sean - 26 May 2005 01:56 GMT
Nevermind, a friend of mine just sent me this link.

http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thre
ad/bf9caf3ce6d3916b/853d3ca687b0efcc?q=dataset+webmethod+return&rnum=1#853d3ca68
7b0efcc


Thanks again,

Signature

Sean


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.