cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

Failed to start workflow. Error ensuring consumption. Obj ref not set to an instance of an object.

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:

WorkflowError.PNG

Error Details from SharePoint Log:

WorkflowError-2.PNGWorkflowError-3.PNG

 

 

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!

 

Labels: (1)
0 Kudos
Reply
1 Reply
Highlighted
Automation Master
Automation Master

Re: Failed to start workflow. Error ensuring consumption. Obj ref not set to an instance of an objec

I guess problems may arise from htmlEscape() used on association data.

HTML encoding and XML encoding are slightly different...

0 Kudos
Reply