2010-02-05 43 views
4

我想在Azure下獲得SSL,WCF和REST,但該頁面甚至不會加載。爲什麼我無法獲得Azure,WCF,REST,SSL項目?我究竟做錯了什麼?

下面是我遵循的步驟:

1)I映射www.mydomain.com CNAME到我azuresite.cloudapp.net

2)I採購的SSL證書www.mydomain.com並正確安裝在我的azuresite.cloudapp.net託管服務項目

3)我部署我的WCF REST服務,Azure和開始它。以下是我的web.config配置。

http(非HTTPS)綁定版本正常工作。我的服務網址http://www.mydomain .com/service.svc/sessions工作得很好。

當我部署與下面的web.config中的項目,啓用SSL,HTTPS://www.mydomain的.com/service.svc /會話甚至沒有拉起來的。

我在做什麼錯?

<system.serviceModel> 
    <services> 
     <service name="Service"> 
       <!-- non-https worked just fine --> 
       <!-- 
       <endpoint address="" binding="webHttpBinding" contract="IService" behaviorConfiguration="RestFriendly"> 
       </endpoint> 
       --> 
      <!-- This does not work, what am I doing wrong? --> 
      <endpoint address="" binding="webHttpBinding" bindingConfiguration="TransportSecurity" contract="IService" behaviorConfiguration="RestFriendly"> 
      </endpoint> 
     </service> 
    </services> 

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

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

回答

1

您可能會缺少服務行爲。嘗試添加此:

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

然後,當你確定你們的服務:

<service behaviorConfiguration="RestService" name="WebService.Rest"> 

編輯

另一件事,可能是問題,是該請求沒有達到你的webrole。你有沒有爲SSL設置一個inputEndpoint?看到http://blogs.msdn.com/b/davethompson/archive/2009/11/24/add-ssl-security-to-your-azure-webrole.aspx