我有一个简单的 IClientMessageInspector:
public class ConsoleMessageTracer : IClientMessageInspector
{
public void AfterReceiveReply(ref Message reply, object correlationState)
{
Console.WriteLine(reply.ToString());
}
public object BeforeSendRequest(ref Message request, IClientChannel channel)
{
Console.WriteLine(request.ToString());
}
}
AfterReceiveReply
工作正常,但BeforeSendRequest
仅... Datastream ...
写入控制台。
(实际上它写道... Datenstrom ...
,因为我有一个德国安装的 .Net 并且Thread.CurrentThread.CurrentCulture
似乎被忽略了。)
如何访问我的请求消息的实际正文?