ns12345
ns12345

Reputation: 3105

WCF and XML, returning XML from stored procedure

I am returning XML from a stored procedure, that I want to capture in WCF and pass on to WPF view.

When I add function import, whats should be selected in returns a collection of, I selected string for now.

And then what should be the return type of the function that would return this data to wpf view, XmlDocument?

Upvotes: 1

Views: 292

Answers (1)

Marc Gravell
Marc Gravell

Reputation: 1062955

So you have an arbitrary block of XML? Then yes, XmlDocument should make that available. The problem with just using a string is that it would get further encoded by WCF. If the layout of the XML is known, another option is deserializing it into an object model and returning that, which might make it easier to consume at the client. But XmlDocument should work.

XElement etc may also be worth a try if that is more convenient.

Upvotes: 1

Related Questions