Saturday, 15 May 2010

javascript - ASP Web API call to /Token intermittent -


Since I have deployed my app in a test environment, call / token (to enter and get token) The problem is that it will not work at all for some calls (takes 30 seconds and then returns 500 errors), then suddenly it will start working (and unable to work, in & lt; 50ms Get answers)

On the Dev Hotel on Localhost, it never Beat Left

My dev setup was at the localhost; My test setup has three servers - one for HTML / JS and an IIS rewriting which points to the other server that hosts the API and the third DB server.

The same response via the following JavaScript:

  var loginData = {grant_type: 'password', user name: self.loginEmail (), password: self.loginPassword ( )}; . $ .ajax ({type: 'POST', URL: that URL + '/ token', data: loginData}) done (function) {self.loggedInUserName (data.userName); // access token in the cash session. Storage sessionStorage.setItem (tokenKey, data.access_token);  

Or if I use the postman I get the same response

Web.config:

  & lt; system.webServer & gt; httpErrors ErrorMode = "Expanded" />   RunAllManagedModulesForAllRequests = "true" & Gt; & lt; name removal = "WebDAVModule" /> gt; & gt; & gt; & gt; httpProtocol & gt; & lt; customHeaders & gt; & lt; add name = "access-rules Allow Feedback-Header "Value =" Content Type "/> Name =" Access-Control-Allow-Methods "value =" get, post, PUT, delete, option "/> ;  

In addition, I've put the following:

Global Configuration. Configuration. Include ErrorDetailPolicy = Include ErrDetailPolicy.Always;

In my global.assx file, but the error message is still not showing (wondering if IIS rewriting them is hiding?)

edit Do: All calls / APIs work lossless, it is only / token that is playing.

Ah what a silly problem

Detailed errors were not working because it was going through IIS rewrite. I started to kill the API directly and the errors were showing which "network path was not found".

I went to the DNS of the DB server, connected to the wrong IP (non-domain one is included). I still think it is strange that it was intermittent but now it seems to work.


No comments:

Post a Comment