Shawn

Shawn Wildermuth

Rocky Lhotka on DataSets and Web Services and why I think he's wrong...


Url: http://www.lhotka.net/WeBlog/CommentView.aspx?g...

After reading Rocky's blog about DataSets and Web Services, I am afraid that he is falling into the same trap that other's have (including the emminently qualified Tim Ewald) with respect to DataSets.  DataSets work well in Web Services but not by default.  As I mentioned in:

http://wildermuth.com/content.aspx?id=rantview&rantid=7

The reason I like DataSets across Web Services so much is simple.  On my side of the interop wall, I can treat them like a set of data-centric objects.  But when I expose them via Web Services, I can treat the entire DataSet as a document.  I like doc-literal web services.  The magic here lies in the fact that the schema of the DataSet can be simply described with XSD.  In fact, for non-typed DataSets that can be described inline with WriteXmlSchema() (so it can be interpreted on the other side of the interop wall). 

For typed DataSets it gets even better.  An XSD is the source of Typed DataSets, so exposing your XSD to describe your 'document' is a natural way of doing things.  In fact, if you're not using ?wsdl for your .NET web services (which you shouldn't!), you can refer to the .xsd to describe the types that your web service expose.

I am passionate about this because creating web services to banty around your business objects is fine, but seems wholly unnecessary.  I hope I can get Rocky to see the light.

Addendum:

I love Sahil's discussion of this too:

http://dotnetjunkies.com/WebLog/sahilmalik/archive/2005/01/23/47832.aspx