即时通讯使用Soap Web服务并即时调用方法,我想获取实际的xml响应,是否有任何方法可以获取呢?

最佳答案

警告:此建议有效,但由于不再支持WSE 3.0,因此您可能希望使用WCF。

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

<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>


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

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

10-12 12:18