简体   繁体   English

即使MessageVersion是Soap11WSAddressing10,WCF也在使用SOAP 1.2

[英]WCF is using SOAP 1.2 even though MessageVersion is Soap11WSAddressing10

My issue is the following. 我的问题如下。 I have received a WSDL to implement in my .NET 4.7.1 ASP.NET application so another company can call an operation from that WSDL that we implement. 我收到了一个在我的.NET 4.7.1 ASP.NET应用程序中实现的WSDL,因此另一家公司可以从我们实现的WSDL调用一个操作。 They require a few specific settings for the WCF service. 它们需要一些特定的WCF服务设置。

  • SOAP 1.1 SOAP 1.1
  • WS-Security 1.0 WS-Security 1.0
  • WS-Addressing 1.0 (2005-08) WS-Addressing 1.0(2005-08)
  • HTTPS (With x509 certs) HTTPS(使用x509证书)
  • They require that we install a specific certificate and that we can validate their certificate with ours and in turn they will validate ours as well because they have our public key. 他们要求我们安装一个特定的证书,我们可以用我们的证书验证他们的证书,反过来他们也会验证我们的证书,因为他们有我们的公钥。 I believe I should use Custom Binding -> Security -> MutualCertificate for this. 我相信我应该使用Custom Binding -> Security -> MutualCertificate I have specified the service and client certificate that should be used. 我已经指定了应该使用的服务和客户端证书。

(Please notice that the WSDL implementation does not require WCF, they say consumers are free to implement it in any language. I chose to use WCF and they have a bit of documentation about it, so I think it should be supported.) (请注意,WSDL实现不需要WCF,他们说消费者可以自由地用任何语言实现它。我选择使用WCF并且他们有一些关于它的文档,所以我认为应该支持它。)

When I import their WSDL directly in SOAP UI, it says it uses SOAP 1.1. 当我直接在SOAP UI中导入他们的WSDL时,它说它使用SOAP 1.1。 The SOAP 1.1 namespace is visible in the WSDL. SOAP 1.1命名空间在WSDL中可见。

When I import my service's WSDL (Which in turns implements the interface generated by their WSDL), It uses SOAP 1.2. 当我导入我的服务的WSDL(它依次实现其WSDL生成的接口)时,它使用SOAP 1.2。 This is a mismatch and very annoying. 这是一个不匹配,非常烦人。

I have found this post: https://stackoverflow.com/a/22255554/3013479 and I tried to remove HttpSoap12 and add HttpSoap . 我发现这篇文章: httpsHttpSoap12我试图删除HttpSoap12并添加HttpSoap I have set the MessageVersion to Soap11WSAddressing10 so it should use SOAP1.1.. But it does not work. 我已将MessageVersion设置为Soap11WSAddressing10因此它应该使用SOAP1.1 ..但它不起作用。

When i use BasicHTTPBinding without any configuration to that binding, it does use SOAP 1.1 当我使用BasicHTTPBinding而没有任何配置到该绑定时,它确实使用SOAP 1.1

This is my binding: 这是我的约束力:

<customBinding>
    <binding>
        <textMessageEncoding writeEncoding="utf-8" messageVersion="Soap11WSAddressing10" />
        <security
            authenticationMode="MutualCertificate"
            enableUnsecuredResponse="false"
            messageProtectionOrder="EncryptBeforeSign"
            includeTimestamp="true"
            defaultAlgorithmSuite="TripleDesRsa15"
            allowSerializedSigningTokenOnReply="false"
            messageSecurityVersion="WSSecurity10WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10"/>
      <httpsTransport requireClientCertificate="true"/>
    </binding>
  </customBinding>

I believe I need a custom binding because in one of their documents they mention some properties from a custom binding. 我相信我需要一个自定义绑定,因为在他们的一个文档中他们提到了自定义绑定的一些属性。 I am not sure though! 我不确定! Also, this binding generates an AssymetricBinding and I believe no other default binding does this. 此外,此绑定生成AssymetricBinding ,我相信没有其他默认绑定执行此操作。

Does anyone have any tips? 有人有任何提示吗? Do you guys need knowledge of the WSDL? 你们需要WSDL的知识吗? In theory, I am not able/allowed to adjust the WSDL because then maybe the service cant connect to us anymore. 从理论上讲,我无法/允许调整WSDL,因为那时服务可能无法连接到我们。 If I do need to adjust the WSDL, please tell me why so I can communicate this with the company. 如果我确实需要调整WSDL,请告诉我为什么我可以与公司沟通。

I have solved this question, the issue is a custom encoder I removed from the question because I thought it was not the item causing this issue. 我已经解决了这个问题,问题是我从问题中删除的自定义编码器,因为我认为它不是导致此问题的项目。 Even though the Custom Encoder specifies Soap11WSAddressing10, it still uses 1.2. 即使Custom Encoder指定Soap11WSAddressing10,它仍然使用1.2。 If I use a normal TextMessageEncoder it works (but that one doesnt suit my needs). 如果我使用普通的TextMessageEncoder它可以工作(但那个不适合我的需要)。 IWsdlExporter should be used to reflect that SOAP 1.1 should be used while genererating the WSDL 应该使用IWsdlExporter来反映在生成WSDL时应该使用SOAP 1.1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM