2015-05-09 62 views
0

我試圖將我的應用部署到Azure。在Azure上部署mvc和wcf

的積累是如下:

  • .NET WCF REST服務女巫確實數據處理
  • 淨MVC應用程序女巫是網站

所以我部署在1個網站,我的服務(xxService.azurewebsites.net)和在其他網站上的應用程序xxApp.azurewebsites.net

我offcorse在兩個應用程序的配置,以允許orginin和東西:

<httpProtocol> 
    <customHeaders> 
    <add name="Access-Control-Allow-Origin" value=<<Address to app>> /> 
    <add name="Access-Control-Allow-Headers" value="Origin, X-Requested-With, Content-Type, Accept" /> 
    <add name="Access-Control-Allow-Methods" value="GET,POST,DELETE,HEAD,PUT,OPTIONS" /> 
    <add name="Access-Control-Allow-Credentials" value="true" /> 
    </customHeaders> 
</httpProtocol> 
<handlers> 
    <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> 
    <remove name="OPTIONSVerbHandler" /> 
    <remove name="TRACEVerbHandler" /> 
    <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> 
</handlers> 

現在我得到的錯誤是連接不允許OPTION調用的到SERVICE

OPTIONS <some POST endpoint> 的XMLHttpRequest無法加載<some POST endpoint>。無效的HTTP狀態代碼405

我也嘗試將WCF部署在MVC應用程序的子文件夾中,但虛擬目錄根本不起作用。

希望任何人有一個想法?

回答