How do I get the XML data that went down the wire from a WCF Service generated from `Add Service Reference`
Assume I have code like this:
var svc = new Namespace.SvcClient();
var request = new Namespace.SvcRequest();
request.SomeProperty = "Value1";
request.SomeProperty = 4.0d;
var response = svc.Request(request);
SetText(response.Result.ToStr开发者_如何学Going());
svc.Close();
What I want to have is the actual XML that got sent out as the result of svc.Request(request);
and the actual XML response from the server, but I want these from WITHIN my application code. I don't want to log it to a file or anything like that. I want to display the xml to the user.
See Configuring Message Logging. You can turn on message tracing and get the exact XML.
精彩评论