我正在尝试使用以下代码在WCF中记录消息,但Message Body
未正确写入;它写成>... stream ...</s:Body>
。它以前用相同的代码编写完整的消息体。
public class MMServiceMessageInspector : IDispatchMessageInspector
{
public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
{
MessageBuffer buffer = request.CreateBufferedCopy(Int32.MaxValue);
request = buffer.CreateMessage();
Helper.LogMessage("Received: " + buffer.CreateMessage().ToString());
return null;
}
}
答案 0 :(得分:0)