记录服务SOAP请求和响应 [英] Logging service SOAP request and response

查看:178
本文介绍了记录服务SOAP请求和响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在C#中记录服务的肥皂请求和响应消息.我有一个现成的肥皂扩展液,可以完成所有这些工作,但是我无法将其添加到服务方法中.

I am trying to log the soap request and response messages of a service in C#. I have a ready made soap extension which does all this, however I am having trouble adding it to the service method.

由于我在VS项目中添加了服务参考,而不是Web服务参考,因此当我检查该服务的参考文件时,看不到正在执行远程服务调用的方法.我看到的所有示例都是添加到具有不同参考格式的Web服务中.

Since I have a service reference added in my VS project and not a web service reference, when i check the reference file for this service, I don't see the method which is doing the invoking of the remote service. All the examples I saw were of adding to a web service, which has a different reference format.

在这种情况下如何记录肥皂消息?

How can I log the soap messages in this case?

推荐答案

Soap扩展仅用于使用基于ASMX的服务或客户端=添加Web参考.使用添加服务引用后,您将改为使用WCF客户端API,并且不能使用Soap扩展.您必须创建消息检查器.

Soap extension is only for using ASMX based service or client = Add web reference. Once you used Add service reference you are using WCF client API instead and you cannot use Soap extension. You must create message inspector instead.

如果仅出于调试目的而需要消息日志记录,则可以使用内置的 WCF消息记录.

If you need message logging only for debugging purpose you can use built in WCF message logging.

这篇关于记录服务SOAP请求和响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆