开发者

WCF JSON SSL configuration

I have a WCF server returning JSON working fine. Until I access the page via SSL (Certificate is installed) I have the following configuration

<system.serviceModel>
<services>
  <service name="Analytics">
    <endpoint name="jsonEP"
            address=""
            binding="webHttpBinding"
            behaviorConfiguration="json"
            contract="IAnalytics"/>     
  </service>
</services>
<behaviors>
  <service开发者_高级运维Behaviors>
    <behavior>
      <serviceMetadata httpGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="json">
      <webHttp faultExceptionEnabled="true" helpEnabled="true" />      
    </behavior>     
  </endpointBehaviors>
</behaviors>

What do I need to change to enable my service to be SSL enabled?

I access the entry page with https://mysite/Service/Analytics.svc but the message gives svcutil.exe http://machinename/Service/Analytics.svc?wsdl

when it should be http://mysite/Service/Analytics.svc?wsdl

Also any Get Requests fail ex: http://mysite/Service/Analytics.svc/MyURITemplate/Id/1

thanks.


You need to define a binding element and set the security to transport.

Have a look at a sample here.


I found the solution.

I had to turn off IIS SSL Setting to Require SSL and follow this configuration. WCF service with JSONP over SSL

I still get the wrong URL in the Analytics.svc "homepage"

"svcutil.exe http://machinename/Service/Analytics.svc?wsdl "

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜