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:
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.
精彩评论