开发者

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

开发者 https://www.devze.com 2023-04-13 03:39 出处:网络
I have a simple WCFservice client in c# that I am using: AccountsSoapClient a = new AccountsSoapClient();

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

精彩评论

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