I am working on a simple .Net 4.0 webservice. I created one method, which accepts a string input. I run the project in Debug mode so a page opens in my browser where I can enter an input and invoke the method of the service. Unfortunately I am getting the following error:
System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (xmlData="<?xml version="1.0" ...").
at System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
at System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, RequestValidationSource requestCollection)
at System.Web.HttpRequest.get_Form()
at System.Web.Services.Protocols.HtmlFormParameterReader.Read(HttpRequest request)
at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
I tried adding
<pages validateRequest="false" />
to the web.config. It does not work.
What can I do?