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 += '<nin:DelegateTask>';
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 += '</nin:DelegateTask>';
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);
}
});
}