2010-01-25 8 views
5

Nos gustaría exponer nuestros servicios WCF a través de REST y también a través de TCP que los protege con SSL. Tenemos un SSL válido cargado en Azure y la configuración de asignación adecuada para que ir al https://service.ourdomain.com funcione como debería.Configuración de enlaces webHTTP y NetHTTP sobre SSL en WCF en Azure

He configurado dos enlaces de punto final, webHttpBinding para los servicios REST y un enlace personalizado de tipo NetHttpBinding para el TCP.

creo que tengo SSL trabajar con webHTTP pero cuando intento y permitir httpsTransport en la costumbre de unión para NetHTTP me sale el error

“No se puede agregar el elemento de transporte 'httpTransport'. Ya existe otro elemento de transporte en el enlace. Solo puede haber un elemento de transporte para cada enlace "

Toda la configuración se ha realizado en WebRole web.config He echado un vistazo a las otras preguntas de WCF presentadas aquí por parte de la gente de Silverlight y me ayudaron con el webHTTP sobre SSL, pero las cosas binarias me han dejado perplejo.

¿Es posible ejecutar los servicios REST y TCP WCF desde el mismo dominio SSL, de ser así, me gustaría saberlo?

<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> 

Respuesta

1

Su dirección de punto final para ambas vinculaciones es la misma. Intente cambiar uno de ellos al Achievements/bin o algo así. Esto debería resolver su problema.

Cuestiones relacionadas