6

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. They require a few specific settings for the WCF service.

  • SOAP 1.1
  • WS-Security 1.0
  • WS-Addressing 1.0 (2005-08)
  • HTTPS (With x509 certs)
  • 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. 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.)

When I import their WSDL directly in SOAP UI, it says it uses SOAP 1.1. The SOAP 1.1 namespace is visible in the WSDL.

When I import my service's WSDL (Which in turns implements the interface generated by their WSDL), It uses 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. I have set the MessageVersion to Soap11WSAddressing10 so it should use SOAP1.1.. But it does not work.

When i use BasicHTTPBinding without any configuration to that binding, it does use 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.

Does anyone have any tips? Do you guys need knowledge of the WSDL? In theory, I am not able/allowed to adjust the WSDL because then maybe the service cant connect to us anymore. If I do need to adjust the WSDL, please tell me why so I can communicate this with the company.

Roman Pokrovskij
  • 9,449
  • 21
  • 87
  • 142
S. ten Brinke
  • 2,557
  • 4
  • 25
  • 50
  • Have you tried using Apache cxf? :) – spy Jun 14 '18 at 11:06
  • @spy No, and quite frankly this is not beneficial to my question. I am using WCF and have not enough java/apache experience. Furthermore, I have finished almost all the code in .NET, rewriting it in Java would be weird, costly, ineffective and not suitable for my company. – S. ten Brinke Jun 14 '18 at 11:13
  • Wcf can be challenging for things like this. Ask them for a sample message that works them compare the output. I have some code that will help log and inspect the output if it will help – spy Jun 14 '18 at 11:20
  • We have a sample message. I can not locally test my binding because Soap UI gives me errors. Their WSDL is different than ours in SOAP Version. I am not sure how your code could benefit my situation, but I have no problem to give it a shot :) – S. ten Brinke Jun 14 '18 at 11:24
  • did you specify the customBinding in your endpoint configuration? – yenta Jun 15 '18 at 09:25
  • @yenta 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. If I use a normal TextMessageEncoder it works (but that one doesnt suit my needs). – S. ten Brinke Jun 15 '18 at 11:19
  • @yenta I have posted a new question with better details of the current problem: https://stackoverflow.com/questions/50876120/wcf-custom-message-encoder-uses-soap1-2-even-though-i-explicitly-specify-1-1 Please help me out if you can! :) – S. ten Brinke Jun 15 '18 at 12:57

1 Answers1

0

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. If I use a normal TextMessageEncoder it works (but that one doesnt suit my needs). IWsdlExporter should be used to reflect that SOAP 1.1 should be used while genererating the WSDL

S. ten Brinke
  • 2,557
  • 4
  • 25
  • 50