cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Delegate Task web services invoking using Jquery

Hi Team, 

Any one please suggest calling delegate task web services using jquery, getting error  "internal server error". Below is my code and find attached form.

function updateassigntowebservicecall()
{
vdelegated = false;
var vvalidation = true;

$('#lblerrmsg').empty();
var vassignto = $('#ddlDelegate').val();
var vcomments = $('#txtComments').text()

if (vassignto == "**SelectValue**")
{
$('#lblerrmsg').text('Please select Delegate.');
vvalidation = false;
}
if (vcomments == "")
{
$('#lblerrmsg').text('Please select Comments.');
vvalidation = false;
}

if (vvalidation == true) {

if (parseInt(vworkfowtaskid) > 0) {

var new_string = "";
new_string += '<?xml version="1.0" encoding="utf-8"?>';
new_string += '<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:nin="http://nintex.com">';

new_string += '<soap:Header/>';
new_string += '<soap:Body>';
new_string += '<ninSmiley Very HappyelegateTask>';
new_string += '<nin:spTaskId>'+ vworkfowtaskid +'</nin:spTaskId>';
new_string += '<nin:taskListName>Workflow Tasks</nin:taskListName>';
new_string += '<nin:targetUsername>' + vassignto + '</nin:targetUsername>';
new_string += '<nin:comments>' + vcomments + '</nin:comments>';
new_string += '<nin:sendNotification>true</nin:sendNotification>';
new_string += '</ninSmiley Very HappyelegateTask>';
new_string += '</soap:Body>';
new_string += '</soap:Envelope>';

alert(new_string);
callwebservicesfordelegation(new_string);

}

}

}

function callwebservicesfordelegation(vwebsericebatch) {

var wsUrl = sitefullurl + "_vti_bin/NintexWorkflow/Workflow.asmx";
$.ajax({
type: "POST",
url: wsUrl,
dataType: "xml",
data: vwebsericebatch,
success: function (data, status, req) {
if (status == "success") {
alert("hi");
}
},
contentType: "text/xml; charset=utf-8",
error: function (requestObject, error, errorThrown) {
alert(requestObject.status + " " + error + " " + errorThrown);
}

});
}

Labels: (1)
0 Kudos
Reply
1 Reply
Workflow Hero

Re: Delegate Task web services invoking using Jquery

the script seems to be correct, so I suspect you do not supply inputs in correct form...

- I do not see you would have populated 'vworkfowtaskid' somewhere

- username (new assignee) has to be provided in a form claim|domain\loginname, which doesn't seem to be your case since you take it directly form a dropdown

0 Kudos
Accept as Solution Reply