Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8110715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:51:03+00:00 2026-06-06T01:51:03+00:00

I’m using the XmlFormView control on a custom aspx page hosted in a SharePoint

  • 0

I’m using the XmlFormView control on a custom aspx page hosted in a SharePoint site.
Recently our SharePoint was upgraded to 2010 and afterwards I’ve been having problems with the form validation triggered by the XmlForm.Submit().

The custom page is actually relying on the exception thrown by SharePoint, if the validation of the submitted form fails. The validation message is formatted and the shown to the user in a friendly way.

When a form containing an invalid user supplied data is submitted, a “Microsoft.Office.InfoPath.Server.Util.InfoPathFatalException” is returned.
This exception doesn’t contain information about witch fields contains invalid data.
Actually I was expecting an “Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterException”.
(The submit is successful and no exception is thrown if the form contains no validation errors)

If I uncheck the “Enable Just My Code (Managed only)” option in Visual Studio and debug the form submit, I get the following exception(contains Danish texts):

Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterException occurred
Message=Formularen kan ikke afsendes, fordi den indeholder valideringsfejl. Fejlene er angivet med en rød stjerne (obligatoriske felter) eller omgivet af en rød, stiplet streg (ugyldige værdier).

Felt eller gruppe: MunicipalRealPropertyIdentifier
Fejl: Der må kun angives et bestemt mønster

Source=Microsoft.Office.InfoPath.Server
BypassWatson=true
LogId=5567
SaveUserSession=false
UserMessage=Formularen kan ikke afsendes, fordi den indeholder valideringsfejl. Fejlene er angivet med en rød stjerne (obligatoriske felter) 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
StackTrace:
at
Microsoft.Office.InfoPath.Server.SolutionLifetime.DatabaseHelper.CheckErrorBoard(Document document, DataAdapter adapter, XPathNavigator subtreeToCheck, Boolean schemaErrorOnly)
InnerException:

This is good! The exception contains information about the validation errors.
I Continue the debug. The desired exception is re-thrown and the output reads:

Step into: Stepping over method without symbols ‘Microsoft.Office.InfoPath.Server.SolutionLifetime.DatabaseHelper.CheckErrorBoard’

Step into: Stepping over method without symbols ‘Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.ExecuteDefaultSubmitAction’

This is still good! I continue the debug, but now the original exception is lost and the InfoPathFatalException is returned.

Microsoft.Office.InfoPath.Server.Util.InfoPathFatalException occurred
Message=Exception of type ‘Microsoft.Office.InfoPath.Server.Util.InfoPathFatalException’ was thrown.
Source=Microsoft.Office.InfoPath.Server
BypassWatson=false
SaveUserSession=false
UserMessage=Der opstod en alvorlig fejl under behandlingen af formularen.
StackTrace:
at Microsoft.Office.InfoPath.Server.Util.GlobalStorage.get_CurrentFormId()
InnerException:

The VS output now reads:

Step into: Stepping over method without symbols ‘Microsoft.Office.InfoPath.Server.SolutionLifetime.DatabaseHelper.CheckErrorBoard’

Step into: Stepping over method without symbols ‘Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.ExecuteDefaultSubmitAction’

Step into: Stepping over method without symbols ‘Microsoft.Office.InfoPath.Server.DocumentLifetime.OMExceptionManager.ExecuteOMCallWithExceptions’

I’m quite a novice when it comes to SharePoint, but I think this smells a bit like a security issue?
It seems the original exception is not “allowed” to bubble back to the caller.

I’ve tried to enable full logging in SharePoint, but when I look at the logs in “..\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS” I can only see the “original” exception, not why it is overwritten?

Additional information:
The site currently runs with the config setting:

<trust level="Full" originUrl="" />

Anybody got any ideas about this issue?

On SharePoint 2007 the desired exception is returned back to the caller.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:51:05+00:00Added an answer on June 6, 2026 at 1:51 am

    Think this question has been open long enough 🙂

    The problem was with the way we used the XMLFormView control.
    Instead of changing our code logic I chose to implement a workaround.

    In short:
    I read this Microsoft documentation:
    http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.server.controls.xmlformview.xmlform

    One of the sections read:

    The XmlForm property can only be accessed during one of the following events:

    • Initialize
    • NotifyHost
    • SubmitToHost
    • Close

    Our code does neither of these!

    Basically we do a postback from a standard button on the aspx page, and from the code behind try to call XmlFormView1.XmlForm.Submit();

    I found out, using .NET Reflector on the Microsoft.Office.Infopath assembly, that when trying to submit HttpContext.Current.Items[“__GlobalStorage.FormIds”] is expected to contain at least one Id form the current form, but at this time it has not yet been set!

    So I did the following little “dirty hack” to make the code work again:

            /// <summary>
        /// Dirty hack to fix issue after update to InfoPath 2010 
        /// </summary>
        private static void InfoPath2010Hack()
        {
            if (HttpContext.Current != null)
            {
                if (HttpContext.Current.Items["__GlobalStorage.FormIds"] == null)
                {
                    var formIds = new Stack<string>();
                    formIds.Push("XmlFormView1");
                    HttpContext.Current.Items["__GlobalStorage.FormIds"] = formIds;
                }
                else
                {
                    var formIds = ((Stack<string>)HttpContext.Current.Items["__GlobalStorage.FormIds"]);
                    if (formIds.Count <= 0)
                    {
                        formIds.Push("XmlFormView1");
                        HttpContext.Current.Items["__GlobalStorage.FormIds"] = formIds;
                    }
                }
            }
        }
    

    Anywhere in the code behind, before I try to access XmlFormView1.XmlForm, I just call InfoPath2010Hack();

    Not a pretty solution, but it works without changing any other logic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.