WCF Message Debugging on WebHttpBehavior

Posted by Programming Hero on Stack Overflow See other posts from Stack Overflow or by Programming Hero
Published on 2010-04-26T20:25:39Z Indexed on 2010/04/28 18:07 UTC
Read the original article Hit count: 512

Filed under:
|
|

I've created a custom binding in WCF for a custom MessageEncoder to allow messages to be written as XML using a wider range of encodings than WCF supports out of the box. The encoder appears to be working and I am able to send and receive messages, but I want to verify that the XML message being written is exactly as required by the service I am trying to consume.

I've turned on message logging for WCF using the diagnostic trace listeners to output the messages sent and received over the wire to a log file. Unfortunately, for calls using my encoder, the message is displayed as ... stream ...

EDIT: I don't think it's anything to do with my custom encoding. I have experimented with my custom binding a little, switching to using the built-in text encoding and http transport. I still don't get a message body logged in the message trace.

EDIT2: Having done further investigation, the issue looks to be related not to the custom binding, but the custom behaviour. I'm apply the <webHttp/> behaviour. Once this is specified (along with manual addressing), the tracing behaviour shows up.

Is this a known issue with WebHttpBehavior? Am I still barking up the wrong tree?

© Stack Overflow or respective owner

Related posts about wcf

Related posts about debugging