DataSets and Web Services

Motivated by the the number of hits on this post (this post is really getting hit by Google) I promoted this post to be an article. This post is therefore no longer up to date so please read and link to the article.

 

Many examples of web services in books, the MSDN and on the web show operations that return DataSets. I think that this is, in general, very bad practice. Now and then I mention this in courses and seminars I teach and it always causes great discussions. So to provide some ammunition for my fellow believers I decided to create this entry (I might even make a article out of it) to refer to.

 

Here are some bullets:


 

And of course we need alternatives! Next to returning arrays of business objects (Customer[]) we can also return xml documents that comply to a specific schema. But how do we create a flexible and at the same time type safe schema?

 

Here are some suggestions by Stephen Kaufman: