我在現有的MVC Web應用程序中添加了一個WCF服務,以便在OLAP多維數據集工具(Syncfusion)上顯示它。當我執行與支持HTTP站點的應用程序會發生什麼,我能夠訪問WCF方法如下圖所示,MVC Web應用程序內託管的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證書? – Mathematics
是的,除了使用wcf方法的Olap cube工具外,我的整個應用程序都可以工作。 – DonMax
也許你應該玩WCF綁定的安全配置https://msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx – chameleon86