Why can't I get my Azure, WCF, REST, SSL project working? What am I doing wrong?
I'm trying to get SSL, WCF and REST under Azure, but the page won't even load.
Here are the steps I followed:
1) I mapped the www.mydomain.com CNAME to my azuresite.cloudapp.net
2) I procured an SSL certificate for www.mydomain.com and properly installed it at my azuresite.cloudapp.net hosted service project
3) I deployed my WCF REST service to Azure and started it. Below is my web.config configuration.
The http (non-https) binding version worked correctly. My service URL, http: //www.mydomain .com/service.svc/sessions worked just fine.
When I deployed the project with the web.config below, enabling SSL, https: //www.mydomain .com/service.svc/sessions does not even pull up at all.
What am I doing wrong?
<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>
<bin开发者_开发问答ding name="TransportSecurity">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</webHttpBinding>
</bindings>
</system.serviceModel>
Did you add the https endpoint to your web role in the ServiceDefinition.csdef file?
It should look something like this:
<WebRole name="WebRole">
<InputEndpoints>
<InputEndpoint name="HttpIn" protocol="http" port="80" />
<InputEndpoint name="HttpsIn" protocol="https" port="443" />
</InputEndpoints>
</WebRole>
See http://blogs.msdn.com/jnak/archive/2009/05/12/https-endpoint-on-windows-azure.aspx for more info.
You may be missing a service behaviour. Try adding this:
<serviceBehaviors>
<behavior name="RestService">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
Then when you define your service:
<service behaviorConfiguration="RestService" name="WebService.Rest">
Edit
Another thing that could be the problem, is that the request is not reaching your webrole. Have you set up an inputEndpoint for SSL? see Link
精彩评论