We are having Aspose subscription for Cloud API. We use it for creating word and pdf documents based on templates. Since last day we are observing error during executeTemplate API.
On debugging the response we found that the content type sent back is changed from xml to json (earlier it was coming as xml)
Here is our code snippet -
String strURI = " http://api.aspose.com/v1.1"
+ “/words/”
+ templateName
+ “/executeTemplate?withRegions=true&”
+ “cleanup=EmptyParagraphs,UnusedRegions,UnusedFields,ContainingFields&filename=”
+ outputFileName;
// sign URI
String signedURI = Utils.Sign(strURI, appKey, appSid);
InputStream responseStream = Utils.ProcessCommand(signedURI, “POST”,
xmlData, “xml”);
String strJSON = Utils.StreamToString(responseStream);
// The format of strJSON was found to be json whereas the above API call was sent with xml as contentType
InputSource source = new InputSource(new StringReader(strJSON));
// Parse the input document
Document doc = null;
try {
DocumentBuilderFactory factory = DocumentBuilderFactory
.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
doc = builder.parse(source);
} catch (ParserConfigurationException parserConfigurationException) {
LOG.error(
"parserConfigurationException occured while parsing document : ",
parserConfigurationException);
} catch (SAXException sAXException) {
LOG.error("sAXException Exception : ", sAXException);
} catch (IOException iOException) {
LOG.error("IOException Exception : ", iOException);
}
The response is attached - response.txt
As you can see it is not in xml format which was expected and was working till couple of days back.
Is there any change on Aspose side? Are we missing any updates/notifications about this change?
We do not have any communication from Aspose if there is any change in API parameters.
Please guide how to resolve this error.
Account that we use on Aspose - api@risesmart.com