我們希望通過REST公開我們的WCF服務,並通過TCP使用SSL保護它們。我們有一個有效的SSL上傳到Azure和適當的映射設置,以便https://service.ourdomain.com正常工作。在Azure上的WCF上通過SSL配置webHTTP和NetHTTP綁定
我已經爲REST服務設置了兩個端點綁定,webHttpBinding和TCP類型爲NetHttpBinding的customBinding。
我覺得我有SSL與webHTTP工作,但是當我試圖使httpsTransport自定義爲NetHTTP結合我得到的錯誤
「不能添加該傳輸元件‘httpTransport’。綁定中已存在另一個傳輸元素每個綁定只能有一個傳輸元素「
所有配置已在WebRole web.config中完成 我已查看了此處提交的其他WCF問題由Silverlight的人和他們幫助通過SSL的WebHTTP,但二進制的東西讓我難住。
是否有可能從同一個SSL域運行REST和TCP WCF服務,如果有的話我想知道嗎?
<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>