Skip to main content
Nintex Community Menu Bar

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

  • Feb 27, 2018 8:37 AM UTC
  • 2 replies
  • 35 views
  • Translate All

Forum|alt.badge.img+6

Hi all

 

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

213632_pastedImage_1.png

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)

2 replies

Forum|alt.badge.img+12
  • Nintex Partner
  • Feb 27, 2018 4:41 PM UTC

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

Translate

AKay
Forum|alt.badge.img+1
  • May 3, 2019 2:19 AM UTC

try importing with firefox browser

Translate