Hi,
I have a ASMX web service in my project and provision has been made in all method to not return the stack trace of any error thrown, as it was required by the security team.
While testing when they pass incorrect JSON parameters, they get an error Invalid JSON Parameters along with a Stack Trace of that error. Like below:-
Error{"Message":"Invalid JSON primitive: descpop.","StackTrace":" at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject()\r\n at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)\r\n at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.DeserializeObject(String input)\r\n at System.Web.Script.Services.RestHandler.GetRawParamsFromGetRequest(HttpContext context, JavaScriptSerializer serializer, WebServiceMethodData methodData)\r\n at System.Web.Script.Services.RestHandler.GetRawParams(WebServiceMethodData methodData, HttpContext context)\r\n at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.ArgumentException"}
If I am not wrong then this error and stack trace is being returned by IIS/Framework. When a cURL request is being sent from a windows environment with incorrect parameters then we don't get any stack trace however when the similar request with incorrect parameters is being sent from the Linux then we get above stack trace.
I am wondering is it possible to disable the stack trace for such errors?
We are using IIS 7 and Framwork 2.0
Any help or pointers would be appreciated.
Thanks in advance:)
Ritesh