开发者

WCF Service client - get Client and Server soap xml as string for internal usage

I have a simple WCF service client in c# that I am using:

   AccountsSoapClient a = new AccountsSoapClient();
    TaskResult res = a.开发者_Go百科OpenAccount();

Is there any way to get the client submitted sop xml and the server response?

for example:

AccountsSoapClient webService = new AccountsSoapClient();
bool res = webService.OpenAccount();

String client = webService.getClientSubmittedXml();
String server = webService.getServerResponseXml();

thanks


If it is for logging purposes you could simply activate tracing. If not you could write a custom message inspector which will allow you to capture the request/response messages. And here's a blog post illustrating a custom inspector.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜