2010-01-25 11 views
5

Vorremmo esporre i nostri servizi WCF su REST e anche su TCP proteggendoli entrambi con SSL. Abbiamo uno SSL valido caricato Azure e l'impostazione di mappaggio corretta in modo che andare a https://service.ourdomain.com funziona come dovrebbe.Configurazione di entrambe le associazioni WebHTTP e NetHTTP su SSL in WCF su Azure

Ho impostato due collegamenti endpoint, webHttpBinding per i servizi REST e un CustomBinding di tipo NetHttpBinding per TCP.

Penso di avere SSL lavorare con webHTTP ma quando provo e permetto httpsTransport nel costume vincolante per NetHTTP ottengo l'errore

“Impossibile aggiungere l'elemento di trasporto 'httpTransport'. Nell'attacco esiste già un solo elemento di trasporto Per ogni rilegatura esiste un solo elemento di trasporto "

Tutta la configurazione è stata eseguita in WebRole web.config Ho dato un'occhiata alle altre domande di WCF qui presentate dal popolo Silverlight e ci hanno aiutato con il webHTTP su SSL ma la roba binario mi ha messo in difficoltà.

È possibile eseguire entrambi i servizi WCF REST e TCP dallo stesso dominio SSL, se sì mi piacerebbe saperlo?

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

risposta

1

L'indirizzo dell'endpoint per entrambi i binding è lo stesso. Prova a cambiare uno di loro a Achievements/bin o qualcosa del genere. Questo dovrebbe risolvere il problema.

Problemi correlati