String In XML body with no header
I have a WCF service with several methods. I would like to log the raw
request that came in from the client regardless of how this was sent. I am
using the below method
public Message CreateMessage(Message message)
{
MessageBuffer buffer = message.CreateBufferedCopy(Int32.MaxValue);
var messageCopy = buffer.CreateMessage();
Console.WriteLine(messageCopy.ToString());
return buffer.CreateMessage();
}
public object AfterReceiveRequest(ref
System.ServiceModel.Channels.Message request,
System.ServiceModel.IClientChannel channel,
System.ServiceModel.InstanceContext instanceContext)
{
request = CreateMessage(request);
return null;
}
I get the XML in result and string in body but with headers I want the
string in body but no header at all. Can anybody help me in this regard.
No comments:
Post a Comment