【问题标题】:The methods method1 and method2 use the same SOAPAction方法 method1 和 method2 使用相同的 SOAPAction
【发布时间】:2010-07-30 23:31:33
【问题描述】:

我正在实现基于另一家公司提供的 wsdl 的 Web 服务。我需要实现一个 webservice-stub 用于测试目的。所以我使用 wsdl.exe 生成客户端和服务器端接口并实现它们。当我进行 web 服务调用时,我得到一个异常,说方法 method1 和 method2 使用相同的 SOAPAction ''。查看 wsdl 显示这两种方法都没有提供soapaction

<operation name="method1">
   <soap:operation soapAction=""/>
...
</operation>
<operation name="method2">
   <soap:operation soapAction=""/>
...
</operation>

当我将客户端连接到 Webservice-stub 时抛出异常,而不是当我连接到真正的 Web 服务时。

有没有办法配置/实现 webservice-stub 以忽略soapAction-Header?

【问题讨论】:

    标签: c# .net web-services soap


    【解决方案1】:

    尝试将SoapDocumentServiceAttribute 的RoutingStyle 属性设置为SoapServiceRoutingStyle.RequestElement

    [SoapDocumentService(RoutingStyle=SoapServiceRoutingStyle.RequestElement, ...)]
    public class ServiceNameHere : System.Web.Services.WebService
    {
       ...
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-18
      • 1970-01-01
      • 2010-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多