.SVC文件生成的Javascript代理URL在SSL下不起作用

时间:2010-07-12 13:37:53

标签: asp.net javascript wcf

我在IIS 7.5中部署了一个ASP.Net网站,其中包含一个文件Cart.svc(用于从浏览器访问Javascript)。

javascript在非SSL下呈现正常,但SSL会导致其停止。但是,如果关闭/ js后缀,即使在SSL下也可以。所以看起来有一个进程正在侦听SSL,它只是不喜欢/ js后缀。

服务器端错误是;

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

更新2:下面的工作配置

  <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>

更新:原始配置

  <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="webHttpBinding" name="CartHttp" bindingName="SslOptionalBinding" contract="MySite.Website.Cart" />
      </service>
    </services>
    <bindings>
      <webHttpBinding>
        <binding name="SslOptionalBinding">
          <security mode="Transport" />
        </binding>
      </webHttpBinding>
    </bindings>
  </system.serviceModel>

提前致谢

赖安

1 个答案:

答案 0 :(得分:2)

您是否设置了绑定的设置以使用传输级安全性?

<binding name="xxx">
    <security mode="Transport"></security>
</binding>

如果您可以发布您的部分,那将有所帮助。