Please find code where issue is occurring.
public String executeTemplateMerge(String FileName, String dataFile) {
String DocName, httpRequestMethod;
try {
if(asposeVersion1_1){
strURI = Aspose.BaseProductUri + ‘/words/’ + FileName + ‘/executeTemplate?cleanup=ContainingFields,EmptyParagraphs,UnusedFields,UnusedRegions,RemoveTitleRow,RemoveTitleRowInInnerTables’;
signedURI = AsposeUtils.Sign(strURI);
httpRequestMethod = ‘POST’;
}else{
FileName = FileName.replace(’ ', ‘%20’);
signedURI = Aspose.BaseProductUri + ‘/words/’ + FileName + ‘/MailMerge?withRegions=True&cleanup=UnusedFields&useWholeParagraphAsRegion=False&destFileName=merge_’+FileName;
accessToken = GetJWT();
httpRequestMethod = ‘PUT’;
}
String strJSON = AsposeUtils.ProcessCommand(signedURI, httpRequestMethod, dataFile, ‘json’, accessToken);
//String downloadURL = null;
Map<String, Object> params = (Map<String, Object>) JSON.deserializeUntyped(strJSON);
if(params.containsKey(‘Document’)){
Map<String, Object> doc = (Map<String, Object>) params.get(‘Document’);
DocName = (String) doc.get(‘FileName’);
}
return DocName;
}
catch (Exception ex) {
system.debug('ASPOSE Merge Service Exception : '+ex);
throw new DataSourceException('ASPOSE Merge Service Exception : '+ex);
}
}
////////////////////////
public with sharing class AsposeUtils {
public static String ProcessCommand(String strURI, String strHttpCommand, String strContent, String ContentType, String accessToken) {
try {
HttpRequest request = new HttpRequest();
Integer len = 0;
if (strContent != null && strContent != ‘’) {
request.setBody(strContent);
len = strContent.length();
}
commonApiExecution(strURI,strHttpCommand,contentType,request,accessToken,len);
if(TEST.isRunningTest() ){
return AhmConstants.ASPOSE_MOCK_RESPONSE_MERGE_CALL;
} else{
Http http = new Http();
HttpResponse res = http.send(request);
return res.getBody();
}
} catch (Exception ex) {
throw new DataSourceException('ASPOSE Service Exception : '+ex);
return null;
}
}
}
/////////////////////////////////
Here is the debug log
Debug log from salesforce.docx (2.8 MB)