【问题标题】:WCF using soap 1.2 generates wsdl with soap 1.1 referenceWCF 使用soap 1.2 生成带有soap 1.1 参考的wsdl
【发布时间】:2014-04-10 21:01:39
【问题描述】:

我正在创建一个 WCF 服务,它必须有一个 soap 1.2 端点。该服务正在使用以下自定义绑定:

    <customBinding>
        <binding name="httpsBinding" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
          <transactionFlow />
          <security authenticationMode="UserNameOverTransport" allowInsecureTransport="true" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" >
            <secureConversationBootstrap allowInsecureTransport="true"></secureConversationBootstrap>
          </security>
          <textMessageEncoding messageVersion="Soap12">
            <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
                maxBytesPerRead="2147483647"
                maxNameTableCharCount="2147483647" />
          </textMessageEncoding>
          <httpsTransport maxReceivedMessageSize="2147483647"  />
        </binding>
      </customBinding>

到这里为止,通过 fiddler 调试时,包的格式正确(soap 1.2):

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Header>...

但在调查生成的 WSDL 时,绑定似乎引用了 soap 1.1 模式。

<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>

WSDL 上没有http://www.w3.org/2003/05/soap-envelope 的引用。虽然它工作正常,但我猜是有问题,因为 WSDL 似乎没有正确描述服务。

【问题讨论】:

  • 您使用的绑定类型是什么?是basichttpbinding吗?
  • customBinding,soap 1.2 协议是在属性 'messageVersion' 上的标签 textMessageEncoding 中定义的

标签: web-services wcf soap wsdl


【解决方案1】:

尝试在web.config (OR) app.config 文件中进行以下更改

<Configuration>
    <webServices>
        <protocols>
            <remove name="HttpSOAP"/>
            <add name="HttpSOAP12" />
        </protocols>
    </webServices>
</configuration>

【讨论】:

【解决方案2】:
<Configuration>
 <system.web>
   <webServices>
     <protocols>
        <remove name="HttpSOAP"/>
        <add name="HttpSOAP12"/>
     </protocols>
  </webServices>
</system.web>

websServices 需要包含在 system.web 部分中。如果不是,则解决方案会引发错误“无法读取配置部分 'webServices',因为它缺少部分声明”

【讨论】:

    猜你喜欢
    • 2017-07-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-21
    相关资源
    最近更新 更多