开发者

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());
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜