I know that this is a question often asked in here, I have tried all the answers, and none of them work. When I consume the webservices I get no error message, and it works ok. But I do get this error 10-20 times each day. So someone do get this error, but I cant reproduce it.
Here is the error stack trace. Any help?
Exception stack trace:
at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
This is how I call the web service:
$.ajax({
type: 'POST',
contentType: 'application/json; charset=utf-8',
url: 'MyWebService.asmx/MyWebService',
data: '{"id":"' + id+ '"}',
dataType: 'json',
success:
function(msg) {
// Do something
},
error:
function(XMLHttpRequest, textStatus, errorThrown) {
// Do something
}
});
This is my very simple web service:
[WebMethod(EnableSession = true)]
public string MyWebService(int id)
{
return "Something";
}
UPDATE:
I see in my logs that the user agent always is Google translate when this error appear.
http://translate.googleusercontent.com/translate_c?hl=es&prev=/search?q=test&hl=es&client=safari&tbo=d&rurl=translate.google.es&sl=en&u=http://www.mydomain.com&usg=ALkJrhhcOM9LJgtG-RhFx1XSQw-g4h_tbQ
You know how I can stop this?