cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

web service ProcessTaskResponse3 call for to-do task error 'Server was unable to process request'

Hi, fellow devs.

I'm using Nintex Workflow 2013 (3.0.4.0) - I know this is not the latest, but it what I have to work with.

I have encountered a problem using the web service call processTaskResponse3 to complete a 'to-do task'.

I used the blog Build a Better Nintex Workflow "Assign To-Do Task" Form to create the workflow, etc.

I need to set the task to 'Complete' programmatically and I'm trying to use the web service call ProcessTaskResponse3 to do this via javascript.

I can get the task id using GetRunningWorkflowTasksForListItem so I know the web service and code works.

The SDK http://help.nintex.com/en-US/SDK2013/#Reference/SOAP/NW_REF_SOAP_ProcessTaskResponse3.htm%3FTocPath%...

provides the following SOAP request which I've used:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:nin="http://nintex.com">

   <soap:Header/>

   <soap:Body>

      <ninSmiley TonguerocessTaskResponse3>

         <nin:comments>First attempt</nin:comments>

         <ninSmiley Surprisedutcome>Continue</ninSmiley Surprisedutcome>

         <nin:spTaskId>3</nin:spTaskId>

         <nin:taskListName>Workflow Tasks</nin:taskListName>

      </ninSmiley TonguerocessTaskResponse3>

   </soap:Body>

</soap:Envelope>

It interesting that 'outcome' is a enum and I would have thought that using the value of 5 = Complete would have been correct but the response says the value is incorrect. Using the string 'Continue' doesn't give this response.

The response I get states:

     "Server was unable to process request. ---&gt; Invalid field name. {819e6cf2-36c3-4013-8aef-c99712c26036}  /Lists/Workflow Tasks"

Can anyone please shed light on how I can get this call to work?

Thanks,

Mark

Labels: (1)
0 Kudos
Reply
9 Replies
Automation Master
Automation Master

Re: ProcessTaskResponse3

Can you provide all the javascript code that you use to execute the web service request ?

0 Kudos
Reply
Not applicable

Re: ProcessTaskResponse3

Caroline, Hi.

I've managed to replicate the problem also using the Call Web Service workflow action, but first here's my code:

var taskId = $("#taskid").val();

var webserUrl = "http://nattstsp03:11495/_vti_bin/NintexWorkflow/Workflow.asmx";
var soapRequest =
'<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:nin="http://nintex.com">' +
'   <soap:Header/>' +
'   <soap:Body>' +
'      <ninSmiley TonguerocessTaskResponse3>' +
'         <nin:comments>First attempt</nin:comments>' +
'         <ninSmiley Surprisedutcome>Continue</ninSmiley Surprisedutcome>' +
'         <nin:spTaskId>' + taskId + '</nin:spTaskId>' +

'         <nin:taskListName>Workflow Tasks</nin:taskListName>' +
'      </ninSmiley TonguerocessTaskResponse3>' +
'   </soap:Body>' +
'</soap:Envelope>';

$.ajax({
        type: "POST",
        url: webserUrl,
        contentType: "text/xml",
        dataType: "xml",
        data: soapRequest,
        success: function (data, status, req) {
               $("#resultWSCall").text(req.responseText);
       },
       error: function (data, status, req) {
              $("#errorWSCall").text(data.responseText); 
       }

});

I've also attached the steps I used to create and test the web service call using the workflow action 'Call Web Service'.

I appreciate your help,

Many thanks

0 Kudos
Reply
Automation Master
Automation Master

Re: ProcessTaskResponse3

Is "http://nattstsp03:11495" the url of your site where the "Workflow Tasks" list is ?

If not, the url of the web service should be like that :

"http://nattstsp03:11495/site_where_the_list_is/_vti_bin/NintexWorkflow/Workflow.asmx"

Hope this is the reason why you have an error

Reply
Not applicable

Re: ProcessTaskResponse3

Caroline, Hi.

Yes indeed the URL for the site is http://nattstsp03:11495 and so the workflow web service URL is http://nattstsp03:11495/_vti_bin/NintexWorkflow/Workflow.asmx

This is a test web application I created just to try to find the problem.

Nintex is correctly installed and configured on this web app and I can run workflows successfully on this.

Regards,

Mark

0 Kudos
Reply
Automation Master
Automation Master

Re: web service ProcessTaskResponse3 call for to-do task error 'Server was unable to process request'

ok and you can correctly access the Workflow Tasks list, there's no error ?

Can you also correctly access the task with ID 3 which is in the Workflow Tasks list ?

In you javascript query, can you add the beforeSend property like this :

$.ajax({
        type: "POST",
        url: webserUrl,
        contentType: "text/xml",
        dataType: "xml",

        beforeSend: function(xhr) {

              xhr.setRequestHeqder("SOAPAction", "http://nintex.com/ProcessTaskResponse3");

        },

        data: soapRequest,
        success: function (data, status, req) {
               $("#resultWSCall").text(req.responseText);
       },
       error: function (data, status, req) {
              $("#errorWSCall").text(data.responseText); 
       }

});

Hope this helps

Reply
Not applicable

Re: web service ProcessTaskResponse3 call for to-do task error 'Server was unable to process request'

Caroline, Hi.

I added the setRequestHeader() method as suggested but I didn't change anything. I set a breakpoint on the line and sure enough it was being set. The same error response was being returned by the call.

The workflow tasks list has no problems. As a work around I update the relevant list item in Workflow Tasks using a REST call and update the Status and PercentageComplete columns directly. This has the effect of completing the task and the workflow moves on, but I figured this is what ProcessTaskResponse3 should do.

Thanks,

Mark

0 Kudos
Reply
Automation Master
Automation Master

Re: web service ProcessTaskResponse3 call for to-do task error 'Server was unable to process request'

Is the task assigned to the user who executes the web service request ?

If not, you can try to first delegate the task to the user who executes the request (with the DelegateTask operation available in Nintex web service) and then process it.

Hope it will work

0 Kudos
Reply
Not applicable

Re: ProcessTaskResponse3

Caroline, Hi.

I posed this question to Nintex support and after a while the response was that the SDK was wrong and has since been updated.

My work around of working with the Workflow Tasks list directly, is the correct method when working with tasks created via the web service call.

ProcessTaskResponse3 does not process to-do tasks. I'm not sure if there is any difference between this and ProcessFlexiTaskResponse2 but that's for another time.

Thank you very much for your help. It was most appreciated.

Regards,

Mark Willmer

Reply
Automation Master
Automation Master

Re: web service ProcessTaskResponse3 call for to-do task error 'Server was unable to process request'

Hi Mark,

Thank you very much for giving us feedback on this issue.

I'm glad that you could find a solution !

Reply