【发布时间】:2016-08-14 12:43:47
【问题描述】:
我在现有 MVC Web 应用程序中添加了 WCF 服务,以便在 OLAP 多维数据集工具 (Syncfusion) 上显示它。当我使用启用了 http 的站点执行应用程序时会发生什么,我可以访问 WCF 方法,如下所示,
代码
$("#OlapClient").ejOlapClient({ url: "/Areas/OLAP/wcf/OlapClientService.svc"});
但是当我从启用https 的站点执行此操作时,我无法访问 WCF 方法。它只是抛出404 method not found exception。这是我的 WCF 的以下 web.config。
Web.config
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="OLAP.wcf.OlapClientServiceAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name="OLAP.wcf.OlapClientService">
<endpoint address="" behaviorConfiguration="OLAP.wcf.OlapClientServiceAspNetAjaxBehavior" binding="webHttpBinding" contract="OLAP.wcf.IOlapClientService">
</endpoint>
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService1" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:15415/VibrantWS.svc/soap"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" />
</client>
</system.serviceModel>
【问题讨论】:
-
您的网站是否有有效的 https 证书?
-
是的,我的整个应用程序都可以工作,除了使用 wcf 方法的 Olap cube 工具。
-
也许你应该使用 WCF 绑定的安全配置 msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx
标签: c# asp.net-mvc wcf https