Nintex for SharePoint Forum
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Hello Team,
I'm getting below error when I try to start workflow using the NintexWorflow/Workflow.asmx using Javascript. No errors in Javascript, but the workflow is failed to start intermittently,
Workflow Error:
Error Details from SharePoint Log:
Below is my Javascript code:
function StartSiteWorkflow(ItemID, ListName, SiteURL, SiteWFName, rfpID,iscomplete){
var assdata = '<Data>'
+ '<RFPID>' + rfpID +'</RFPID>'
+ '<WithdrawnComplete>'+ iscomplete +'</WithdrawnComplete>'
+ '</Data>';
assdata = htmlEscape(assdata);
var sr = '<?xml version="1.0" encoding="utf-8"?>'
+ '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
+ 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" '
+ 'xmlns:m="http://nintex.com">'
+ '<soap:Header>'
+ '</soap:Header>'
+ '<soap:Body>'
+ '<m:StartSiteWorkflow>'
+ '<m:workflowName>' + SiteWFName + '</m:workflowName>'
+ '<m:associationData>'
+ assdata
+ '</m:associationData>'
+ '</m:StartSiteWorkflow>'
+ '</soap:Body>'
+ '</soap:Envelope>';
$.ajax({
url: SiteURL + "/_vti_bin/NintexWorkflow/Workflow.asmx",
async: false,
beforeSend: function (xhr) {
xhr.setRequestHeader("SOAPAction", "http://nintex.com/StartSiteWorkflow");
},
type: "POST",
dataType: "xml",
data: sr,
success: function () {
//Success method
},
contentType: "text/xml; charset=utf-8",
error: function (requestObject, error, errorThrown) {
console.log(requestObject.status + " " + error + " " + errorThrown);
}
});
}
Please share your inputs to fix this issue. Thanks!
I guess problems may arise from htmlEscape() used on association data.
HTML encoding and XML encoding are slightly different...