简体   繁体   English

WCF服务客户端 - 将Client和Server soap xml作为字符串以供内部使用

[英]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: 我在c#中使用了一个简单的WCF服务客户端:

   AccountsSoapClient a = new AccountsSoapClient();
    TaskResult res = a.OpenAccount();

Is there any way to get the client submitted sop xml and the server response? 有没有办法让客户端提交sop xml和服务器响应?

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. 这是一篇描述自定义检查器的博客文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM