我在IIS7.5中部署了一个ASP.Net网站,其中包含一个文件Cart.svc(用于从浏览器进行Javascript访问)。
服务器端错误为;
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>
赖安