WSHttpBinding in .NetStandard or .NET core

后端 未结 1 1479
灰色年华
灰色年华 2021-01-05 16:04

I want to integrate NMVS protocol in my application which is providing wsdl files for testing which is written sample code in .net framework library.

I want to test

相关标签:
1条回答
  • 2021-01-05 16:29

    Here is a solution for your problem :

    var transportSecurityBinding = new BasicHttpBinding();
    transportSecurityBinding.Security.Mode = BasicHttpSecurityMode.Transport;
    transportSecurityBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
    
    var customTransportSecurityBinding = new CustomBinding(transportSecurityBinding);
    
    var textBindingElement = new TextMessageEncodingBindingElement
    {
          MessageVersion = MessageVersion.CreateVersion(EnvelopeVersion.Soap12, AddressingVersion.None)
    };
    
    // Replace text element to have Soap12 message version
    customTransportSecurityBinding.Elements[0] = textBindingElement;
    
    0 讨论(0)
提交回复
热议问题