gSOAP客户端的WCF服务

时间:2011-11-14 14:04:59

标签: c# .net wcf soap gsoap

我收到了构建服务的请求,以便从预先设计的客户端处理流量。

文档声明该服务是SOAP服务,但我后来发现预先设计的客户端使用的协议是使用SOAP 1.2的gSOAP

我得到的问题是,在将绑定分配给basicHttpBinding错误时,我得到了Action '' not supported,因为客户端没有发送SOAPAction标头(因为它未用于SOAP 1.2)如果我使用wsHttpBinfing设置WCF服务的绑定,我会收到错误

HTTP/1.1 415 
Cannot process the message because the content type 'text/xml; charset=utf-8' 
was not the expected type 'application/soap+xml; charset=utf-8'.

基本上,他们使用的gSOAP客户端似乎发送了SOAP 1.2的SOAP结构,但是使用了SOAP 1.1的Content-Type

我的问题是如何让我的WCF服务来处理来自客户端的请求。 (不能以任何方式修改客户端)

我尝试过设置customBinding

<customBinding>
    <binding name="myCustomBinding">
      <textMessageEncoding messageVersion="Soap12" />
      <httpTransport/>
    </binding>
</customBinding>

具有各种messageVersion值。但我还没有找到一个有效的组合。

1 个答案:

答案 0 :(得分:3)

通过创建自定义Dispatcher来解决基于SOAPBody的调用问题。

Microsoft WCF Samples中的解决方案。

样本发现于:

Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4

确切示例(基于安装样本的文件夹)

  

扩展\互操作\ AdvancedDispatchByBody

相关问题