How to use LINQ with ServiceModel.Channels.Message
How can i use LINQ with ServiceModel.C开发者_JAVA技巧hannels.Message? I'd like to use LINQ to the SOAP message body.
I initially tried doing this:
XElement elem = XElement.load(message.GetReaderAtBodyContents());
But that piece of code complains that XMLReader should be EOF after the read operation. What is the correct way to do this?
OK, I think I found a solution:
XDocument document = XDocument.Parse(message.GetReaderAtBodyContents().ReadOuterXml());
精彩评论