Handling ADO.NET DataSets with Axis

by Dejan Bosanac

First of all, SOAP is not my web service protocol of choice since I think it is overkill for the most of applications. I prefer the simplest possible solution for the problem, but when the service that you need is only available through SOAP, you don't have much choice.

The fact is that .NET developers like SOAP and use it as a de-facto the only way to expose their services. Simplicity to do so is certainly one of the most important factors in this decision. While there is nothing generally wrong with this, the simplicity hides some traps for those that don't take care. One such trap is making methods return (or accept parameters) of general types such as ADO.NET DataSet (something like JDBC ResultSet in Java).

5 Comments

y
2006-08-03 11:48:40
"The fact is that .NET developers like SOAP and use it as a de-facto the only way to expose their services. "


Ohh, boy you should learn .NET

Steve
2006-08-03 14:25:16
Was this posted correctly? Check out windowsdevcenter.com.
DD
2007-04-04 12:39:28
The fact that MS suggests not to use datasets when exposing webservices says all.
I've been exactly in the situation exposed in the article (it was the hell!). By knowing the element's names, and using the getChildren() method and the getObjetcValue(Class) method of MessageElement do the work nicely.
Its important to remark that get_any()[0] is the schema of the dataset (trash), and get_any[1] is the diffgram in which the data to fill the beans resides.


Hope it helps... and please, Mr Gates, for once in your live, visit the w3c web and read a little.

pc
2007-08-29 15:57:34
Hi Steve, I'm in this exact same situation now and it appears as the link (http://tools.devchannel.org/devtoolschannel/04/07/09/1650215.shtml?tid=21&tid=46)
is dead, redirecting to linux.com


Do you know of any other resource which may be a good reference on how to get around this?

Prakash Gautam
2008-02-27 03:41:34
I am going through hell. I have googled for a whole week but no solution. I am able to consume the Dataset as suggested above but the REAL problem is that the .Net web service method also takes a Dataset parameter. Axis generated a stub class for the Dataset which has the constructor as follows:


public UploadChangesDs(
org.apache.axis.message.MessageElement [] _any) {
this._any = _any;
}



Could you PLEASE suggest how can I fill the 'UploadChangesDs' and call the .Net web service method which takes a Dataset.


I am desperate and I will be really grateful.


Thanks