InfoPath Forms Services Error: schema validation found non-data type

So I got my first taste of working with the new SharePoint 2010 Managed Client Object Model...and just one exaggerated word: Saw-weeeeeet. I used it to write a module that would programmatically add an attachment to an InfoPath 2007 document stored in SharePoint. Ironically enough, the COM code worked right out of the gate and it was the XML DOM manipulation code that proved the most finicky. It's alot of code so I'm not going to post it all up, but if you have a need to programmatically manipulate InfoPath (XML) documents stored within SharePoint - shoot me an email and I'll send you a code sample.

That said, I thought I'd post a quick blurb about one of the obscure gotchas I encountered on this project. I was seeing the following error when trying to open the InfoPath document in InfoPath Forms Services after making the programmatic changes:

schema validation found non-data type

Initial searching turned up a bunch of articles referring to the xsi:nil attribute, but that was not my issue. In fact, I used a text editor to compare the 2 files (an XML document created in InfoPath Forms Services and an XML document modified by my programmatic code) - disregarding case and spacing, and they were identical! However I realized that a couple of the tags in the programmatically saved document had a line feed inserted between their opening tag and closing tag, and more importantly - removing the line feeds fixed the problem! (The fact that trivial white-space was capable of invalidating InfoPath's schema is a testimony to its instability in my opinion, but whatever - job security, right?)

Many hours and dead ends later, I eventually stumbled onto this posting http://social.msdn.microsoft.com/Forums/en-US/xmlandnetfx/thread/0be81446-3be6-458a-a2e7-7a86e05ee85d, instructing me to set the XMLDocument's "PreserveWhitespace" property to true in order to prevent it from imposing its own space-formatting on the XML content output.
That fixed it...and I blogged it ;-)

Posted on 5/28/2010 5:06:00 AM by sterlingt

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: MOSS 2007 | SharePoint 2007 | SharePoint 2007 Features

Tags:

Installing SharePoint 2007/2010 with Active Directory 2000

The first order of business should be upgrading your domain controller since apparently SharePoint 2007+ doesn't play nice with this legacy version of AD (http://msmvps.com/blogs/obts/archive/2006/09/27/143844.aspx). If that's not an option before your install of SharePoint, you'll need to do the following in order to use any domain accounts for the various SharePoint service accounts (required if you're building a multi-server farm).

Disable domain digital encryption on all SharePoint servers:
  1. Navigate to Administrative Tools > Local Security Policy
  2. Expand 'Local Polices'
  3. Select 'Security Options'
  4. Navigate to the 'Domain member: Digitally encrypt or sign secure channel data (always)' item within the main display pane and right click > properties - disable.
  5. Repeat the previous step for the 'Domain member: Digitally encrypt secure channel data (when possible)' and 'Domain member: Digitally sign secure channel data (when possible)' items.
  6. RESTART ALL SERVERS (This change will not take effect until the relevant server is restarted.
This should alleviate the problems with locating domain users based on their 'friendly' Netbios name rather than SID's. Without this change you will receive the following error when trying to provide domain account credentials for the farm service account while running the SharePoint configuration wizard:

The username is invalid. The account must be a valid domain account.

In addition, when trying to add a domain account login to the Sql Server instance you will receive the following error:

Create failed for login…Windows NT user or group domain\username not found. Check the name again.

Couldn't find any documentation on the 'net regarding this obscure scenario, so I wanted to share my insight. Disclaimer: I'm not a sys-admin so I cannot comment on the security compromises that this change might introduce.

Posted on 5/12/2010 8:55:00 AM by sterlingt

Permalink | Comments (3) | Post RSSRSS comment feed |

Categories: MOSS 2007 | SharePoint 2007 | WSS 3.0

Tags:

"Serious XSS flaw haunts Microsoft SharePoint"

Posted on 5/4/2010 4:39:00 AM by sterlingt

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: MOSS 2007 | SharePoint 2007 | SharePoint 2007 Features | WSS 3.0

Tags: