Free Support Forum -

Microsoft Word Document Mail Merge operation using Aspose.Words REST API problem


I am performing Rest merge for Word document and is getting the following exception while using Words cloud API. The response in fact contain Junk characters.

PMsAXException Exception : org.xml.sax.SAXParseException: Content is not allowed in prolog. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) ~[xercesImpl-2.8.1.jar:na] at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) ~[xercesImpl-2.8.1.jar:na]

Enclosing initial few characters of the response -
ÿþ< S a a S p o s e R e s p......

The spaces are actually \0 character. When we removed all \0 chars and ÿþ, things started working.
It is strange that this started happening just today.

We also tried with json format as output parameter and there was valid json returned. So it looks like the issue is only with xml format.

Has anything changed at your end? THis is second time (the same API few months back switched from xml to json format in spite of API parameter requesting xml format. Related issue - something has broken on your side without any prior updates. Our production system is actively using your APIs and is under risk now. Please respond ASAP with what is the ETA on resolving this.

Many Thanks,

This message was posted using Email2Forum by Mudassir Fayyaz.

Hi Shridhar,

We are investigating the issue and will update you soon. Sorry for the inconvenience.

Best Regards,

Hi Shridhar,

executeTemplate API is working as expected and returning the same response as it was returning before. Can you please share your complete code to reproduce the issue?

Best Regards,


For your information, we have introduced an improved V4 API Version since Aspose.Words Cloud 19.4. In new version, we have also joined “ExecuteMailMerge” and “ExecuteTemplate” methods. Now API has only “ExcecuteMailMerge” method which can be used with both template types: “mailmerge fields” or “mustache”. We have also introduced storage API methods in Aspose.Words Cloud API, so now there is no need to use Aspose.Storage Cloud API for storage operations.