[英]Hosted WCF service inside MVC Web application
我在現有的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>
如果您正在使用.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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.