tags:

views:

38

answers:

1

Hi all,
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

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!

+1  A: 

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.

tomasr