c# - 从 Soap WebService 获取实际响应

标签 c# web-services webservice-client

我正在使用 Soap Web 服务并调用一个方法,我想获取实际的 xml 响应,有什么方法可以获取它吗?

最佳答案

警告:此建议有效,但由于不再支持 WSE 3.0,您可能需要查看 WCF。

通过使用 WSE 3.0,您可以管理通过 Web 服务客户端和服务器发送的 xml。为此,您需要更改 web.config 文件,将这些行添加到“配置”标记下的文件开头

<configSections>
    <section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</configSections>

然后在“/system.web”之后添加以下行:

<microsoft.web.services3>
    <diagnostics>
        <trace enabled="true" input="InputTrace.webinfo" output="OutputTrace.webinfo"/>
    </diagnostics>
</microsoft.web.services3>

通过执行这些操作,您将获得包含 xml 格式的输入和输出 SOAP 消息的 InputTrace.webinfo 和 OutputTrace.webinfo 文件。

关于c# - 从 Soap WebService 获取实际响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3822526/

相关文章:

web-services - 如何将 Web 服务绑定(bind)到特定的 glassfish 端口?

java - 如何在不安装到 keystore 的情况下连接到 SSL 证书 Web 服务?

cxf - 动态调用 Web 服务的简便方法(无需 JDK 或代理类)

c# - "else if()"与 C# 中的多个 "if()"

c# - 如何使用 C# 中的关联应用程序执行多个 ".ext"

c# - 如何注销 Owin 提供商?

c# - 由于 "does not have the matching return type"错误,泛型类型的接口(interface)实现失败

java - 具有空响应的 Spring Integration WS Gateway

java - 为 CXF 服务生成客户端代码的最佳方式是什么?

java - 无法捕获 AxisFault 异常