2016-04-21 76 views
4

我在現有的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> 
+0

您的網站是否有有效的https證書? – Mathematics

+0

是的,除了使用wcf方法的Olap cube工具外,我的整個應用程序都可以工作。 – DonMax

+0

也許你應該玩WCF綁定的安全配置https://msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx – chameleon86

回答

0
  1. 如果.Net的工作框架4.5先進的服務工作,請確保以下簡稱「.NET框架4.5工作先進型服務WCF Serivce選項下IIS配置 HTTP激活(需要檢查)「。

  2. 確保web.config中的以下設置在下面提到的鏈接中。

https://msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx

Enable SSL for my WCF service

HTTPS-enabled, IIS hosted WCF service, How to secure it?

  • 嘗試WEB API控制器代替WCF服務來避免這個問題。
  • +0

    謝謝,我開始使用WebAPI,然後它就像一個魅力沒有任何像WCF一樣的配置設置的麻煩喧囂。 – DonMax

    相關問題