Read WCF Message body twice - “Message Cannot be read”

与世无争的帅哥 提交于 2019-12-08 17:19:28

问题


I have a WCF Message (Channels.Message) which i'm trying to extract the body using .GetBody(). however, i notice that i can do it only once, and if i'm trying to use "GetBody<>" again, i'm getting :"This message cannot support the operation because it has been read."

Any idea how can i re-read the message body?

thanks


回答1:


Here is a pretty good article about what you are trying to do on MSDN. Please see the section titled Copying a Message into a Buffer. It explicitly talks about having to access the message body more than once.

http://msdn.microsoft.com/en-us/library/ms734675.aspx



来源:https://stackoverflow.com/questions/2184806/read-wcf-message-body-twice-message-cannot-be-read

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!