Partilhar via


Unable to publish an InfoPath form to Sharepoint when there is no root site collection

I recently came across an interesting issue while publishing an InfoPath form. When we are trying to publish an Infopath form to the Sharepoint site collection, we got the below trimmed pop error message (trimmed completely).

  • When I tried to publish it to other site collections in different web applications, I was able to publish successfully. The only difference between the working and the non-working scenario is that the web application in the non-working scenario didn't have the root site collection "/".

In the fiddler trace,  we are seeing 401 when the request is going to webs.asmx and the request is going through the root site.

POST https://<site collection name>/_vti_bin/webs.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: https://schemas.microsoft.com/sharepoint/soap/WebUrlFromPageUrl
X-Office-Version: 14.0.5128

Cause:

  • When we publish the InfoPath template the template gets copied to the forms folder in the Sharepoint library and this goes as a WebDAV request.

SOAPAction: https://schemas.microsoft.com/sharepoint/soap/GetListContentTypes

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="https://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema"><soap:Body><GetListContentTypesResponse xmlns="https://schemas.microsoft.com/sharepoint/soap/"><GetListContentTypesResult><ContentTypes ContentTypeOrder="0x01010100DC185DBC959A0C48AEC172B44A668F10"><ContentType Name="Form" ID="0x01010100DC185DBC959A0C48AEC172B44A668F10" Description="Fill out this form." Scope="https://sp2013-13r/sites/123/asdf" Version="28"><XmlDocuments><XmlDocument NamespaceURI="https://schemas.microsoft.com/sharepoint/v3/contenttype/forms"><FormTemplates xmlns="https://schemas.microsoft.com/sharepoint/v3/contenttype/forms"><Display>DocumentLibraryForm</Display><Edit>DocumentLibraryForm</Edit><New>DocumentLibraryForm</New></FormTemplates></XmlDocument></XmlDocuments></ContentType><ContentType Name="Folder" ID="0x012000CFF8159696099D4184D50EB2D7CC69C9" Description="Create a new folder." Scope="https://<site collection name>" Version="0"><XmlDocuments><XmlDocument NamespaceURI="https://schemas.microsoft.com/sharepoint/v3/contenttype/forms"><FormTemplates xmlns="https://schemas.microsoft.com/sharepoint/v3/contenttype/forms"><Display>ListForm</Display><Edit>ListForm</Edit><New>ListForm</New></FormTemplates></XmlDocument></XmlDocuments></ContentType></ContentTypes></GetListContentTypesResult></GetListContentTypesResponse></soap:Body></soap:Envelope>

  • This is the below response when we have root site collection.

OPTIONS https://<site collectoin name>/ HTTP/1.1
User-Agent: Microsoft Office Protocol Discovery
Host: <host name>

HTTP/1.1 200 OK
Cache-Control: private,max-age=0
Allow: GET, POST, OPTIONS, HEAD, MKCOL, PUT, PROPFIND, PROPPATCH, DELETE, MOVE, COPY, GETLIB, LOCK, UNLOCK
Content-Length: 0
Expires: Thu, 20 Aug 2015 22:26:24 GMT
Accept-Ranges: none
Server: Microsoft-IIS/8.5
X-SharePointHealthScore: 3
MS-Author-Via: MS-FP/4.0,DAV
X-MSDAVEXT: 1

  • But when we remove the root site collection, we are getting a 401.
  • When you are using WebDAV request, you need root site collection.

Resolution:

We need a root site collection in the web application when we publish the InfoPath form.

Fore more information about root site collection and WebDAV request, refer the below KB article.

https://support.microsoft.com/en-us/kb/2625462

Thanks Rajeev for helping me to figure out the Root Cause!