0

I have a self hosted WCF service that is hosted by a C# executable. I was wondering if anyone has a way to log/inspect messages coming into the host (so that the host can display the messages on its UI; say in a rich text editor or a devexpress grid or some other control).

I know there is a way to log/inspect messages coming into the service, but I want to have the host show the messages instead.

Stevie White
  • 569
  • 1
  • 7
  • 24
  • Something like Wireshark? Maybe it's / the LUA api? – Austin T French Dec 21 '16 at 22:30
  • 1
    The solution consists in implementing a message inspector and code AfterReceiveRequest(ref Message request,, ...) function. The tricky issue in this function is that, when you read the message body, you must recreate a new instance of the input Message, because reading the input stream empties the message. *That's the reason of the "ref" in the first function parameter*: see the MessageToString() function in this [*link*](https://www.snip2code.com/Snippet/724073/A-sample-Message-inspector-for-MessageBo) – Graffito Dec 21 '16 at 23:20

0 Answers0