Tutorial :web service being called twice with jquery ajax function



Question:

I am using the $.ajax function in jquery to make a call to an asmx service. When I look at the requests from fiddler, I see two requests for each call I make. One has a content type of text/html which of course returns a 401 not authorized status, and the other one has the correct content type and returns the correct data. Can anyone tell me why it is doing this and how I can fix it or if it needs fixing?


Solution:1

That is normal when you have anonymous requests disabled (you probably have Windows authentication enabled). The 401 is a challenge asking for the credentials.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »