WCF - Multiple schema HTTP and HTTPS in the same service
- by Ender
I am trying to set up WCF service in production. The service has two bindings with two different interfaces. One endpoint (basicHttpBinding) is set up at HTTP and the other endpoint (wsHttpBinding) is set up securely over SSL.
I can't get this scenario to work. Everything works with no problem if both endpoints are set up over HTTP.
Before I even get into the specifics of errors I get, is is possible to run secure and insecure endpoint over the same service ?
Here is a brief description of my configuration:
<serviceBehaviors>
<behavior name="MyServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceCredentials>
<serviceCertificate findValue="123312123123123123123399451b178"
storeLocation="LocalMachine"
storeName="My"
x509FindType="FindByThumbprint" />
<issuedTokenAuthentication allowUntrustedRsaIssuers="true"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding" maxReceivedMessageSize="2147483647">
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="wsHttpBinding" maxReceivedMessageSize="2147483647">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName" establishSecurityContext="False"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="MyServiceBehavior" name="MyService">
<endpoint binding="wsHttpBinding" bindingConfiguration="wsHttpBinding" contract="IMyService1">
</endpoint>
<endpoint address="mms" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding"
contract="IMyService2">
</endpoint>
<endpoint address="mex" listenUri="" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
Thanks !