views:

31

answers:

2

Hi Guys!!

I am reading data and filling a data set and want to return xml, in a .net web service. so far I am trying to use

return mydataset.getxml();

but it is not helping as my method return type is "DataSet"

so is there any way I can get a well formatted xml.

Thanks

A: 

Your web service can serialize its output to whatever you want it to.

All you need to do is to return the dataset, and what it will be serialized to depends on what is requested by the client.

Depending on how you're invoking the service, you should be able to set a 'dataType' parameter.

David Hedlund
A: 

(NOTE: I'm assuming you want to return a raw xml string from your method as the body payload of the webservice)

You could declare your return type of the webservice as a string then pass back the text representation of the xml you want

saret