views:

495

answers:

2

We have a .NET 2 SOAP web service meant for consumption by another app that is internal to our organisation. The web service returns a .NET dataset like so:

public System.Data.DataSet GetStatementFor(string contractList,
  System.DateTime startDate, System.DateTime endDate)

Now in one of the use cases it is necessary to get to the DataSet object's XML. Now obviously the DataSet is being returned via XML in any case, so I was wondering if it is possible to just use the XML that represents it in SOAP. Normally the XML is wrapped into a DataSet object which I will then need to serialize once again. Can I skip these last two steps and still return a DataSet for the cases where it makes sense?

A: 

I'm confused what you want. DataSet will be serialized to XML and deserialized on the other end back into a DataSet why do you need to care about the underlaying XML?

Lloyd
Indeed. I don't understand it either, but that was the request I got.
Cobus Kruger
A: 

No, the WebService transfers a DataSet in SOAP formatting, which is different form the format DataSet.WriteXml() uses.

Henk Holterman
Yes, I understand that. But is it possible to get my hands on that SOAP formatting? It still encodes the dataset's meta and data, so it should do for their purposes. As I understand, they essentially plan to push it through a XSL transform to get into the format they want.
Cobus Kruger
Prying it from the WebService communication would be messy. But you can run it through a SOAP formatter after reception. I would double check what 'they' want first though.
Henk Holterman
I think the plan is to feed it into existing code that takes a string of XML. Perhaps I should just tell them to do as you say - DataSet.WriteXML() will work, but I thought it could be possible to skip the conversions from and to XML.
Cobus Kruger
No, the XML you're looking for does not exist. You're thinking there's a string or XmlDocument sitting around somewhere. Not so. What if the message was large?
John Saunders