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:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

"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:

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Custom Search Scope Error - 'Your search cannot be completed because of a service error. Try your search again or contact your administrator for more information.'

When creating custom search scopes within MOSS 2007, be wary of mixing 'shared' search scopes and 'local' search scopes within a single display group. If you create a search scope at the site collection level (via the Site Settings > Site Collection Administration > Search Scopes menu), the scope will inherently be local. Note the absence of a check-mark in the 'Shared' column when viewing the site collection scope administrative page ([Site Collection URL]/_layouts/viewscopes.aspx?mode=site). The default 'People' and 'All Sites' search scopes are shared. Combining both a local and shared search scope into a single display will generate the following error within the search results if a user selects a combination of the 2:

Your search cannot be completed because of a service error. Try your search again or contact your administrator for more information.

To avoid this issue, either define your new search scope as shared by creating it within the SSP scope admin page ([SSP URL]/ssp/admin/_layouts/viewscopesssp.aspx?mode=ssp) rather than the site collection scope admin page. Or create a custom search display group that contains ONLY shared or ONLY local search scopes, so users won't be able to select both.

Posted on 4/30/2010 6:59:00 AM by sterlingt

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

Categories: MOSS 2007 | SharePoint 2007 Features

Tags:

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Making MOSS 2007 and WSS 3.0 play nicely with Adobe Acrobat PDF Documents


Seeing any of the following behavior when interacting with PDF documents within SharePoint?
  • The document could not be opened for editing. A Windows Sharepoint Services compatible application could not be found to edit the document.
  • There was an error opening this document. The file cannot be found.
  • Missing/blank icon for PDF documents
Add this line to one-liner to your DOCICON.XML document (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML):
<Mapping Key="pdf" Value="pdf.gif" OpenControl="SharePoint.OpenDocuments"/>

And put the corresponding pdf.gif image in the SharePoint IMAGES directory (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES).

If users are annoyed by the in-browser method with which PDF documents are opened, that setting must be changed via the Adobe Reader application itself - Edit > Preferences > Internet, uncheck the 'Display PDF in browser' box.

Posted on 4/2/2010 6:34:00 AM by sterlingt

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

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

Tags:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

SharePoint 2007 Back-up Schedule & Recovery Procedures

It's critical to develop and document a tested back-up schedule and disaster recovery plan which will replicate both the database content of SharePoint, as well as the web server(s) settings and customizations. In spite of SharePoint's database-centric content storage system, most deployments contain a healthy number of enhancements and customizations to their SharePoint instance inextricably linked to the state of their web server(s). Failing to replicate and store back-ups of the web server(s) themselves will likely dramatically increase recovery and restoration downtime.

Since data loss disasters come in multiple levels of severity, it's important to have recovery procedures that address each. I suggest a 3-tiered approach:
  1. Entire server farm restoration process (complete web server and database loss).
  2. Web application, site, and site collection restoration process (database content loss).
  3. Individual content object restoration process (recycle bin).
If possible, backing up the entire web server(s) with an image of the box (or VM) is ideal, at an interval appropriate for your system's size and rate of change. I also suggest creating an image of the box immediately before applying any patches/updates. In addition to imaging the entire SharePoint web server(s), I also backup the servers' individual 12 hive directories (C:\Program Files\Common Files\Microsoft Shared\Web server extensions\12) and Inetpub directories (C:\Inetpub). These directories hold most of the pertinent files involved in SharePoint customizations and configuration, and provide another layer of security in the case the server images are lost or damaged. The following is a list of potential SharePoint settings and configurations maintained within the web server(s):
  • Application Pool settings, including service accounts (all accounts that run as Web applications, including the crawler account and the search account).
  • Secure Sockets Layer (SSL) certificates
  • Alternate access mapping settings
  • Farm-level search settings
  • Activated features
  • 12 hive - (C:\Program Files\Common Files\Microsoft Shared\Web server extensions\12)
  • GAC – global assembly cache; a protected operating system location where .NET framework code assemblies are installed to provide full system access (C:\WINNT\assembly)
In addition, it is generally a good idea to maintain a complete and up-to-date list of SharePoint databases and the web application(s)/site collection(s) they map to. SharePoint databases should be backed up appropriately based on the frequency of content changes within your system, generally a daily incremental and weekly full SQL back-up schedule is a good starting point. The weekly (or daily) database back-ups should be stored somewhere off-site in the event recovery from a catastrophic loss (i.e. your office or datacenter burns down).

Ensuring your recycle bin settings are correctly configured will often save you major headaches when users (inevitably) accidentally delete content. Navigate to Central Admin > Application Management > Web Application General Settings and scroll down to the bottom of the page to find the recycle bin settings for the current selected web application (change selection at the top of the page). By default, SharePoint activates web application recycle bins and stores deleted content in it for 30 days, after which the deleted content is moved to the 2nd stage recycle bin (the site collection level recycle bin) where it is stored indefinitely unless the 2nd stage space quota is reached. The space quota is set by default to 50% of the total space allocated to the web application itself.

An important point to note about recycle bins (so important I'm putting it in bold): Site and site collection deletion is not managed through the Recycle Bins – content contained within deleted sites/site collections will be permanently lost. (One reason I don't allocate full permissions to sites as part of my governance policy.)

I hope these points of preponderance provide you with some inspiration and/or guidance when devising your own SharePoint back-up schedule and recovery procedure because (at the risk of sounding super-cliche) - when it comes to SharePoint - failing to plan is planning to fail.

Posted on 3/22/2010 6:53:00 PM by sterlingt

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

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

Tags:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5