Returning data sets from web services is not typically considered a “good practice”. The issues have been documented thoroughly in the following links:
http://msdn.microsoft.com/en-us/magazine/cc163751.aspx
http://www.4guysfromrolla.com/articles/051805-1.aspx
http://msdn.microsoft.com/en-us/magazine/cc188755.aspx
In summary, the biggest issues with returning DataSet
objects from web services seem to involve serialization performance, non-.net interoperability. In addition, the generic, polymorphic nature of the DataSet
generally high the data structure until runtime, as such, the WSDL definition does not provide a complete description of the method signature. As with any design decision, however, you need to weigh the costs vs the benefits and determine the best fit given your specific goals and constraints.
In terms of alternatives, you could consider using a generic collection (e.g. List<yourClassHere>
) or maybe even consider some architecture revisions to permit the use of ODATA.
The following links provide some good background reference for returning entities via web services.
http://msdn.microsoft.com/en-us/library/orm-9780596520281-01-14.aspx
http://www.codeproject.com/Articles/127395/Implementing-a-WCF-Service-with-Entity-Framework
http://msdn.microsoft.com/en-us/data/hh237663.aspx