• WebServcies 调用方法异常:System.Web.HttpRequestValidationException: 从客户端中检测到有潜在危险的 Request.Form 值。


    我在做WebServcies时,页面调试,报类了下面这样的错误信息:

    System.Web.HttpRequestValidationException: 从客户端(checkXML="<?xml version="1.0" ...")中检测到有潜在危险的 Request.Form 值。
       在 System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
       在 System.Web.HttpRequest.<>c__DisplayClass5.<ValidateHttpValueCollection>b__3(String key, String value)
       在 System.Web.HttpValueCollection.EnsureKeyValidated(String key)
       在 System.Web.HttpValueCollection.Get(String name)
       在 System.Web.Services.Protocols.ValueCollectionParameterReader.Read(NameValueCollection collection)
       在 System.Web.Services.Protocols.HtmlFormParameterReader.Read(HttpRequest request)
       在 System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
       在 System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

    百度后,获得解决方案:

    在Web.config配置文件中,向节点<httpRuntime> 里添加属性 requestValidationMode="2.0",即可解决问题。(其实,requestValidationMode的值只要是4.0以下都可以。具体原因,百度搜索validateRequest="false" 设置无效 有帖子回答这个问题,这里就不说明原因了。)

    参考:http://www.cnblogs.com/vingi/articles/2478134.html

  • 相关阅读:
    标记场景发生改变
    粗体EditorGUI
    unity shader 编辑器扩展类 ShaderGUI
    让打开文件夹直接在某路径打开
    利用asset存储mesh
    获取输入的键
    2013 Visual Studio Magazine读者选择奖界面框架类获奖情况
    DevExpress VCL 13.1.4支持Delphi /C++Builder XE5
    DevExpress更新至13.1.7
    转:与Microsoft Visual Studio集成良好的第三方工具
  • 原文地址:https://www.cnblogs.com/lishidefengchen/p/4735930.html
Copyright © 2020-2023  润新知