I found a solution:
In .Net 4, you need to add the following line under <system.web>:
<httpRuntime requestValidationType="MyService.CustomRequestValidator" />
The CustomRequestValidator class is a test that you must add yourself. Then just override the bool IsValidRequestString () method and return true to exclude the check:
public class CustomRequestValidator : RequestValidator
{
protected override bool IsValidRequestString(HttpContext context, string value, RequestValidationSource requestValidationSource, string collectionKey, out int validationFailureIndex)
{
validationFailureIndex = -1;
return true;
}
}
}