SharePoint URL Changes and InfoPath Forms


InfoPath Form Template URL

We have a solution that makes extensive use of online and offline InfoPath forms in a MOSS 2007 environment. An upgrade to SharePoint 2010 is due in a few months, including a redesign of Managed Paths and Site Collection ‘hierarchy’ having a direct effect on the URL of our Site Collection.

I thought this meant a lot of work for converting the thousands of InfoPath XML Forms by script, because they all contained an absolute URL to the InfoPath Form Template.

However as it seems after restoring the Site Collection all forms automagically had a corrected absolute URL to their template !!

<?xml version="1.0"?>
<?mso-infoPathSolution productVersion="12.0.0" PIVersion="1.0.0.0" href="https://public.contoso.com/sites/csapp/FormServerTemplates/LeaveRequest.xsn" name="urn:schemas-microsoft-com:office:infopath:LeaveRequest:-myXSD-2009-05-29T07-59-01" solutionVersion="1.0.0.422" ?>
<?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.2"?>
<my:Data  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"
          xmlns:tns="http://public.contoso.com/webservices"
          xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
          xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
          xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
          xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns:xhtml="http://www.w3.org/1999/xhtml"
          xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/"
          xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-05-29T07:59:01"
          xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"
          xml:lang="nl-be">
  <!-- Form content -->
</my:Data>
 

Default Alternate Access Mapping

What happens is that when you restore a Site Collection backup, it looks up the Web Application by the URL you specified as a parameter. From that Web Application, it takes the Alternate Mapping configured on the "Default” Zone and uses that URL to construct the absolute URL in the InfoPath XMLs.

Only at restore time

This mechanism only seems to trigger when the restore takes place. Changing the Default AAM afterwards to a different URL has no effect. You could temporarily change the AAM for the restore operation and then set it back if you want. Beats any script iterating and updating all Form XMLs any day.

 

Most of the times you expect the worst from SharePoint, but then it catches you by surprise and brings a huge smile to the face :)

 


Links to this post

Comments

CAPTCHA Image Validation