当前位置: 代码迷 >> 综合 >> C# webservices 之发布调用【5】
  详细解决方案

C# webservices 之发布调用【5】

热度:9   发布时间:2023-12-22 09:25:34.0

报错:

System.Web.HttpRequestValidationException: 从客户端(XmlText="<DATAPACKET><ROWDATA...")中检测到有潜在危险的 Request.Form 值。在 System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)在 System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, 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()

配置如下即可

 <compilation debug="true" targetFramework="4.0" /><httpRuntime requestValidationMode="2.0" /><pages validateRequest="false"/>