开发者

Copy the RequestMessage at IParameterInspector.BeforeCall() on WCF Service

I have WCF service with IParameterInspector class which suppose to store the message for each incoming message. I need to extract values from the inputs parameters.

In order to get the message I'm trying to access

Blockquote OperationContext.Current.RequestContext.RequestMessage Blockquote

开发者_Python百科and than call to CreateBufferedCopy() method to create a copy so I can work (read) the message and send it forward, but than I'm getting the following error:

"This message cannot support the operation because it has been read."

Any ideas? Many thanks!


IParameterInspector is fired after the message has been read by the data contract/xml serializer so the message body has been already consumed.

If you want to get the raw input message, you should be doing so in an IDispatchMessageInspector instead and make a buffered copy of the message so that you can still pass it on further down the WCF pipeline.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜