【发布时间】:2013-10-10 16:05:14
【问题描述】:
我在 SharePoint 网站中托管的自定义 aspx 页面上使用 XmlFormView 控件。 最近我们的 SharePoint 升级到 2010,之后我遇到了由 XmlForm.Submit() 触发的表单验证问题。
如果提交的表单验证失败,自定义页面实际上依赖于 SharePoint 引发的异常。验证消息经过格式化并以友好的方式显示给用户。
提交包含无效用户提供数据的表单时,将返回“Microsoft.Office.InfoPath.Server.Util.InfoPathFatalException”。 此异常不包含有关女巫字段包含无效数据的信息。 实际上我期待“Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterException”。 (如果表单不包含验证错误,则提交成功,不抛出异常)
如果我在 Visual Studio 中取消选中“仅启用我的代码(仅限托管)”选项并调试表单提交,我会收到以下异常(包含丹麦文本):
发生 Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterException
Message=Formularen kan ikke afsendes, fordi den indeholder valideringsfejl。 Fejlene er angivet med en rød stjerne (obligatoriske feeler) eller omgivet af en rød, stiplet streg (ugyldige værdier)。
Felt eller gruppe:MunicipalRealPropertyIdentifier
Fejl: Der må kun angives et bestemt mønster
源=Microsoft.Office.InfoPath.Server
BypassWatson=true
日志 ID=5567
SaveUserSession=false
UserMessage=Formularen kan ikke afsendes, fordi den indeholder valideringsfejl。 Fejlene er angivet med en rød stjerne (obligatoriske feeler) eller omgivet af en rød, stiplet streg (ugyldige værdier)。
Felt eller gruppe:MunicipalRealPropertyIdentifier
Fejl: Der må kun angives et bestemt mønster
OverrideTopLevelMessage=true
堆栈跟踪:
在
Microsoft.Office.InfoPath.Server.SolutionLifetime.DatabaseHelper.CheckErrorBoard(文档文档、DataAdapter 适配器、XPathNavigator subtreeToCheck、Boolean schemaErrorOnly)
内部异常:
这很好!异常包含有关验证错误的信息。 我继续调试。重新抛出所需的异常,输出内容为:
步入:跳过没有符号“Microsoft.Office.InfoPath.Server.SolutionLifetime.DatabaseHelper.CheckErrorBoard”的方法 步入:跳过没有符号“Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.ExecuteDefaultSubmitAction”的方法
这个还是不错的!我继续调试,但现在原始异常丢失并返回 InfoPathFatalException。
发生 Microsoft.Office.InfoPath.Server.Util.InfoPathFatalException
消息 = 引发了“Microsoft.Office.InfoPath.Server.Util.InfoPathFatalException”类型的异常。
源=Microsoft.Office.InfoPath.Server
绕过Watson=false
SaveUserSession=false
UserMessage=Der opstod en alvorlig fejl under behandlingen af formularen.
堆栈跟踪:
在 Microsoft.Office.InfoPath.Server.Util.GlobalStorage.get_CurrentFormId()
内部异常:
VS 输出现在显示为:
步入:跳过没有符号“Microsoft.Office.InfoPath.Server.SolutionLifetime.DatabaseHelper.CheckErrorBoard”的方法 步入:跳过没有符号“Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.ExecuteDefaultSubmitAction”的方法 步入:跳过没有符号“Microsoft.Office.InfoPath.Server.DocumentLifetime.OMExceptionManager.ExecuteOMCallWithExceptions”的方法
对于 SharePoint,我还是个新手,但我认为这听起来有点像安全问题? 似乎原始异常不是“允许”返回给调用者的。
我尝试在 SharePoint 中启用完整日志记录,但是当我查看“..\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS”中的日志时,我只能看到“原始" 异常,不是为什么会被覆盖?
附加信息: 该站点当前使用配置设置运行:
<trust level="Full" originUrl="" />
有人对这个问题有任何想法吗?
在 SharePoint 2007 上,所需的异常被返回给调用者。
【问题讨论】:
标签: sharepoint sharepoint-2010 xmlformview