Ajax请求添加到Excel的Azure ASP.net Web服务中

我目前正在尝试从Excel中添加一个ajax POST调用Azure托pipe的Web服务。当我在本地主机上进行testing时,ajax请求工作正常,但是当我尝试使用这个请求时,它给了我一个NetworkError呼叫。 我使用的代码是:

var user = { UserName: "username", Password: "password" } $.support.cors = true; $.ajax({ crossDomain: true, type: "POST", contentType: "application/json; charset=utf-8", url: "http://qa-verso-enterprise-service.azurewebsites.net/VersoApiService.svc/AddIn/Login", data: JSON.stringify(user), dataType: 'json', traditional: true, async: false, cache: false, success: function (json) { console.log("Success"); }, error: function (er) { console.log("Error"); } }); 

我试图模拟jsfiddle上的调用。 你可以在这里find它: http : //jsfiddle.net/Uwcuz/4530/

我也尝试使用DCH铬扩展的呼叫,一切似乎都很好。 chrome-extension://aejoelaoggembcahagimdiliamlcdmfm/dhc.html使用POST方法和数据:

 { "UserName": "username", "Password": "password" } 

这确实返回了用户名无效。

读了一下,我补充道

 <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> <add name="Access-Control-Allow-Headers" value="Content-Type" /> <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" /> </customHeaders> </httpProtocol> 

到我的networking服务的networkingconfiguration,但没有工作。

我真的不知道还能做什么…有什么意见?