I am getting the following error when I call my webservice method.
Origin http://localhost:4165 is not allowed by Access-Control-Allow-Origin.
I have found the answer for my question. Just add the following to your web.config file
Also if you dont want it to be set up globally, then you can add it to your action method alone as below:
[WebMethod]
public string HelloWorld()
{
HttpContext.Response.Headers.Add("Access-Control-Allow-Origin", "*");
return "Hello User";
}