简体   繁体   中英

deploying a mvc and wcf on Azure

I am trying to deploy my app to azure.

The buildup is as followed:

  • .Net WCF REST Service witch does data handling
  • .Net MVC App witch is the site

So I deployed my service on 1 site (xxService.azurewebsites.net) and the App on the other site xxApp.azurewebsites.net

I offcorse made in the config of both apps to allow orginin and stuff:

<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>

Now the Error I am getting is that the connection is not allowing OPTION call's to the SERVICE :

OPTIONS <some POST endpoint> XMLHttpRequest cannot load <some POST endpoint> . Invalid HTTP status code 405

I also tryed to deploy the WCF on a subfolder in the MVC app with Virtual directory but that is not working at all.

Hope anyone got an idea?

Mybe someone will end up with the same problem.

Follow the solution in this post and you will get it working Publish Multiple Projects to Different Locations on Azure Website

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM