Javascript proxy URL generated by .SVC file does not work under SSL
I have an ASP.Net web site deployed in IIS 7.5 with a file Cart.svc (used for Javascript access from the browser).
The javascript renders fine under non SSL but SSL causes it to halt. However, if you take the /js suffix off, it works, even under SSL. So it looks like there IS a process listening on SSL, it just does not like the /js suffix.
The server side error is;
WebHost failed to process a request.
Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/66851296
Exception: System.Web.HttpException (0x80004005): There was no channel actively listening at 'https://xxxx/ws/Cart.svc/js'. This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service
Update 2: Working config below
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name="MySite.Website.Cart" >
<endpoint address="" behaviorConfiguration="MySite.Website.CartAspNetAjaxBehavior" binding="webHttpBinding" bindingConfiguration="webHttpBinding" contract="MySite.Website.Cart" />
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="webHttpBinding">
<security mode="Transport" />
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="MySite.Website.CartAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
Update: Original config below
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="MySite.Website.CartAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name="MySite.Website.Cart">
<endpoint address="" behaviorConfiguration="MySite.Website.CartAspNetAjaxBehavior"
binding="webHttpBin开发者_运维知识库ding" name="CartHttp" bindingName="SslOptionalBinding" contract="MySite.Website.Cart" />
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="SslOptionalBinding">
<security mode="Transport" />
</binding>
</webHttpBinding>
</bindings>
</system.serviceModel>
Thanks in advance
Ryan
Have you set your binding's settings to use Transport level security?
<binding name="xxx">
<security mode="Transport"></security>
</binding>
If you can post your section, that would help.
精彩评论