我在现有的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>
答案 0 :(得分:0)
如果您正在使用.Net Frame work 4.5高级服务,请确保“.Net Frame work 4.5高级服务WCF服务选项HTTP激活(需要检查)”下的IIS配置。
确保web.config中的以下设置如下面的链接所示。
https://msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx
HTTPS-enabled, IIS hosted WCF service, How to secure it?