WCF 服务客户端 - 获取客户端和服务器soap xml 作为内部使用的字符串
我有一个简单的 C# WCF 服务客户端,我正在使用:
AccountsSoapClient a = new AccountsSoapClient();
TaskResult res = a.OpenAccount();
有没有办法让客户端提交 sop xml 和服务器响应?
例如:
AccountsSoapClient webService = new AccountsSoapClient();
bool res = webService.OpenAccount();
String client = webService.getClientSubmittedXml();
String server = webService.getServerResponseXml();
谢谢
I have a simple WCF service client in c# that I am using:
AccountsSoapClient a = new AccountsSoapClient();
TaskResult res = a.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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果是出于日志记录目的,您只需激活跟踪。如果没有,您可以编写一个自定义消息检查器,它允许您捕获请求/响应消息。这是博客文章 说明自定义检查器。
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.