Configuring webHTTP and NetHTTP bindings over SSL in WCF on Azure

We would like to expose our WCF services through REST, as well as through TCP, providing them both with SSL. We have valid SSL uploaded to Azure and the mapping is configured correctly, so switching to https://service.ourdomain.com works as it should.

I set up two endpoint bindings, webHttpBinding for REST services, and set up a binding of type NetHttpBinding for TCP.

I think my SSL works with webHTTP, but when I try to enable httpsTransport in a user binding for NetHTTP, I get an error

"Cannot add transport element 'httpTransport'. Another transport element already exists in the binding. For each binding there can be only one transport element

The whole configuration was done in WebRole web.config Ive looked at other WCF questions presented here by Silverlight users and they helped with webHTTP over SSL, but the binary puzzled me.

Can I run REST and TCP WCF services from the same SSL domain, if I would like to know?

<system.serviceModel>
<bindings>
  <webHttpBinding>
    <binding name="SecureWebHttpBinding">
      <security mode="Transport">
        <transport clientCredentialType="None"  />
      </security>
    </binding>
  </webHttpBinding>

  <customBinding>
    <binding name="NetHttpBinding">
      <binaryMessageEncoding />
      <!--<httpsTransport authenticationScheme="None" />-->
    </binding>
  </customBinding>
</bindings>

<behaviors>
  <endpointBehaviors>
    <behavior name="webBehavior">
      <webHttp />
    </behavior>
   </endpointBehaviors>

   <serviceBehaviors>
    <behavior name="RestService">
      <serviceMetadata httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>

    <behavior name="BinaryService">
      <serviceMetadata httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>

  </serviceBehaviors>
</behaviors>

<services>
  <service behaviorConfiguration="RestService" name="WebService.Rest">
    <endpoint address="Achievements" 
              binding="webHttpBinding" 
              bindingConfiguration="SecureWebHttpBinding" 
              behaviorConfiguration="webBehavior" 
              contract="WebService.JSON.IAchievementJSON"/>
</service>

  <service behaviorConfiguration="BinaryService" name="WebService.Binary">
    <endpoint address="Achievements"
              binding="customBinding"
              bindingConfiguration="NetHttpBinding"
              contract="WebService.BinaryInterfaces.IAchievementBinary"/>
  </service>
 </services>
</system.serviceModel>
+5
source share
1 answer

. /bin - . .

+1

All Articles