Logging SOAP Raw Response Received by a ClientBase object

前端 未结 2 1337
甜味超标
甜味超标 2021-02-06 08:20

I have an application that uses a ClientBase object generated by a service reference to call a third party WCF SOAP service. Every once in awhile, the service call returns a fau

2条回答
  •  太阳男子
    2021-02-06 08:33

    You may consider another approach to capture XML - custom MessageEncoder. Unlike IClientMessageInspector it handles original byte content of http body.

    You need to wrap a standard textMessageEncoding with custom message encoder as new binding element and apply that custom binding to endpoint in your config.

    Also you can look how I did it in my project - wrapping textMessageEncoding, logging encoder, custom binding element and config.

提交回复
热议问题