System.Web.HttpRequestValidationException: 从客户端(dbFlag="<soap:Envelope xmlns...")中检测到有潜在危险的 Request.Form 值。
   在 System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
   在 System.Web.HttpRequest.ValidateHttpValueCollection(HttpValueCollection collection, RequestValidationSource requestCollection)
   在 System.Web.HttpRequest.get_Form()
   在 System.Web.Services.Protocols.HtmlFormParameterReader.Read(HttpRequest request)
   在 System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
   在 System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

WebService报错:
通过WebService页面上的参数文本框传值(xml字符串)request validation的时候为了防止危险的客户端输入就会抛HttpRequestValidationException。

解决方法:

<system.web>
  <pages validateRequest="false"/>
  <httpRuntime requestValidationMode="2.0"/>
</system.web>

 

validateRequest="false" 存在安全隐患

警告:为了安全请不要随意将ASP.Net的validateRequest="false" . 

 

相关文章:

  • 2021-06-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2022-01-23
  • 2021-09-22
相关资源
相似解决方案