0

I found WCF WsDualHttpBinding accept http, however https is not acceptable. I got following errors if https is used:

System.ArgumentException: The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: context.ListenUriBaseAddress
at System.ServiceModel.Channels.TransportChannelListener..ctor(TransportBindingElement bindingElement, BindingContext context, MessageEncoderFactory defaultMessageEncoderFactory, HostNameComparisonMode hostNameComparisonMode)
at System.ServiceModel.Channels.HttpChannelListener..ctor(HttpTransportBindingElement bindingElement, BindingContext context)
at System.ServiceModel.Channels.HttpChannelListener`1..ctor(HttpTransportBindingElement bindingElement, BindingContext context)

My environment is Win7 pro, .net 4.0, VS2013 pro.

Here attached my settings:

<wsDualHttpBinding>
  <binding name="customWsDualHttpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
    <readerQuotas maxDepth="2147483647" maxArrayLength="2147483647"
                    maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    <security mode="Message">
        <message clientCredentialType="Certificate" />
    </security>
  </binding>
</wsDualHttpBinding>

<service name="Reporting.DuplexService" behaviorConfiguration="customBehavior">
    <endpoint address="http://localhost:8123/Reporting/Duplex"
              binding="wsDualHttpBinding" bindingConfiguration="customWsDualHttpBinding"
              contract="WcfServices.Interfaces.IDuplexReportingService"/>
</service>

When I put serviceCertificate info in customBehavior element, above service is working, however it's still using http as transport channel, although message is encrypted by certificate.

is it possible to use https in this scenario? thanks in advance.

kind regards

Mulder2008
  • 181
  • 3
  • 8
  • What happens if you set `` on the binding? That should switch over to https. – Tim Feb 05 '16 at 04:04
  • ConfigurationErrorsException is thrown, with this error --- Unrecognized element 'transport' --- – Mulder2008 Feb 05 '16 at 05:33
  • Try `` - it's probably a case sensitivity issue. – Tim Feb 05 '16 at 06:04
  • same error, the auto-complete list shows "none" and "message" only for security mode in vs2013, so I think transport mode is not supported at all. – Mulder2008 Feb 05 '16 at 07:29
  • You're correct - "Transport" is not available for `wsDualHttpBinding`: [MSDN](https://msdn.microsoft.com/en-us/library/ms731363%28v=vs.110%29.aspx) – Tim Feb 05 '16 at 07:39

0 Answers0