cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Failed to retrieve file content. Error: An XML declaration is required for all non-UTF8 documents

Hi all

 

I am trying to import file from our Dev to Prod but i'm getting below error message.

Searching ULS logs for this Correlation ID I found these messages. 

--------------------------------------------------------------------------------------------

Failed to retrieve file content. Error: An XML declaration is required for all non-UTF8 documents.. Stack trace:
at System.Xml.EncodingStreamWrapper.ReadBOMEncoding(Byte b1, Byte b2, Byte b3, Byte b4, Boolean notOutOfBand, Int32& preserve)
at System.Xml.EncodingStreamWrapper.ReadBOMEncoding(Boolean notOutOfBand)
at System.Xml.EncodingStreamWrapper..ctor(Stream stream, Encoding encoding)
at System.Xml.XmlUTF8TextReader.SetInput(Stream stream, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose)
at System.Runtime.Serialization.XmlObjectSerializer.ReadObject(Stream stream)
at Nintex.Forms.NfUtilities.DeserializeObjectWithDataContractSerializer(String xml, Type type)
at Nintex.Forms.NfUtilities.DeserializeObject(String xml, SerializationType method, Type type)
at Nintex.Forms.FormsHelper.XmlToObject(String formMarkup)
at Nintex.Forms.SharePoint.ApplicationPages.ImportForm.GetLocalFileContent(String fileName)

--------------------------------------------------------------------------------------------

Failed to handle import form post back. Error: An XML declaration is required for all non-UTF8 documents.. Stack trace:
at System.Xml.EncodingStreamWrapper.ReadBOMEncoding(Byte b1, Byte b2, Byte b3, Byte b4, Boolean notOutOfBand, Int32& preserve)
at System.Xml.EncodingStreamWrapper.ReadBOMEncoding(Boolean notOutOfBand)
at System.Xml.EncodingStreamWrapper..ctor(Stream stream, Encoding encoding)
at System.Xml.XmlUTF8TextReader.SetInput(Stream stream, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose)
at System.Runtime.Serialization.XmlObjectSerializer.ReadObject(Stream stream)
at Nintex.Forms.NfUtilities.DeserializeObjectWithDataContractSerializer(String xml, Type type)
at Nintex.Forms.NfUtilities.DeserializeObject(String xml, SerializationType method, Type type)
at Nintex.Forms.FormsHelper.XmlToObject(String formMarkup)
at Nintex.Forms.SharePoint.ApplicationPages.ImportForm.GetLocalFileContent(String fileName)
at Nintex.Forms.SharePoint.ApplicationPages.ImportForm.RaisePostBackEvent(String eventArgument)

-----------------------------------------------------------------------------------------------

Application error when access /_layouts/15/NintexForms/ImportForm.aspx, Error=An XML declaration is required for all non-UTF8 documents.
at System.Xml.EncodingStreamWrapper.ReadBOMEncoding(Byte b1, Byte b2, Byte b3, Byte b4, Boolean notOutOfBand, Int32& preserve)
at System.Xml.EncodingStreamWrapper.ReadBOMEncoding(Boolean notOutOfBand)
at System.Xml.EncodingStreamWrapper..ctor(Stream stream, Encoding encoding)
at System.Xml.XmlUTF8TextReader.SetInput(Stream stream, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose)
at System.Runtime.Serialization.XmlObjectSerializer.ReadObject(Stream stream)
at Nintex.Forms.NfUtilities.DeserializeObjectWithDataContractSerializer(String xml, Type type)
at Nintex.Forms.NfUtilities.DeserializeObject(String xml, SerializationType method, Type type)
at Nintex.Forms.FormsHelper.XmlToObject(String formMarkup)
at Nintex.Forms.SharePoint.ApplicationPages.ImportForm.GetLocalFileContent(String fileName)
at Nintex.Forms.SharePoint.ApplicationPages.ImportForm.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

0 Kudos
Reply
1 Reply
Workflow Hero

Re: Failed to retrieve file content. Error: An XML declaration is required for all non-UTF8 documents

Hi,

It looks you are trying to export and import the Nintex Form from DEV to PROD,possibility is the form might have corrupted or something is wrong, give a try with the below steps:

1. Make sure your form has no issues in the DEV environment and it is working properly. 

2. Make sure it is published (saved on also fine)

3. Do a fresh export

4. Then import to PROD

0 Kudos
Accept as Solution Reply