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

Re: Start a Workflow using a Web Service

Hi, I am using StartWorkflowOnListItem method for starting the workflow. But each time I start the workflow, it ends showing the error message:

"Failed to invoke web service. Object reference not set to an instance of an object."

Although, the another workflow to be started starts as it should. I don't understand if this workflow is failing how the other one is starting and if the other one is starting successfully, then why is the error message showing up every time?

0 Kudos
Reply
Highlighted
Not applicable

Re: Start a Workflow using a Web Service

We have the same problem here: Other workflow starts but the starting WF throws an error.

As a workaround, we catch and ignore the error, but I would like to really resolve this somehow.

Any news on this?

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Start a Workflow using a Web Service

Hello,

i had this problem, when calling web service on root site, but the list was on a subsite. Is your list on a subsite?

Reply
Highlighted
Not applicable

Re: Start a Workflow using a Web Service

OK. I don't really get how to start the Workflow with a variable. The Article tells me to do it in associationData but I guess I'm doing something wrong. I'm using Ajax to start the workflow which works just fine just the Variable is never set. My SOAP looks like this

var soap ='<?xml version=\"1.0\" encoding=\"utf-8\"?>' +

'<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">' +

'<soap:Body>' +

'<StartWorkflowOnListItem xmlns=\"http://nintex.com\">' +

'<itemId>' + itemId + '</itemId>' +

'<listName>' + listName + '</listName>' +

'<workflowName>' + wfName + '</workflowName>' +

'<associationData>' +

'<testComment>TEST123456</testComment>' +

'</associationData>' +

'</StartWorkflowOnListItem>' +

'</soap:Body>' +

'</soap:Envelope>';

Any idea what I'm doing wrong passing the testComment Variable? I also tried wrapping the variable in an additiona <Data>-Tag. Doesn't make any difference sadly. Would be great if someone knew the answer to this. Greetings Chris

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Start a Workflow using a Web Service

Hi,

I am trying to build a workflow to copy list items that is greater than a year "created" to another list in the same site. It is also required to delete the list items once it is copied to archive, but i am running into error:

Failed to invoke web service. Error returned from server: <soap:Fault xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>soap:Server</faultcode><faultstring>Server was unable to process request. ---&gt; The selected workflow 'Archive Quote

Below is my workflow. Later i am going to add delete list item as well if this was working . I have followed exactly as instructed. Any pointers is appreciated.

quote_log.JPG

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Start a Workflow using a Web Service

I am running into an issue where I'm getting an "Error returned from server: 401 UNAUTHORIZED" error. However, I am using a farm administrator for the credentials. What else could cause this type of error?

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Start a Workflow using a Web Service

Perhaps to further clarify my question. It looks like if I "schedule" my workflow it will complete without error. If I start it manually, it fails with the above error on the web-service call.

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Start a Workflow using a Web Service

Hi,

Your farm admin may or may not have access to the site where you are executing the web service. Have you logged in with farm admin to the site and checked whether you can access it? You can create workflow constant of Credentials type and grant the same account access on the site instead of farm admin. Also, just for your clarity, you may start a new thread and reference this article there.

your update just negated my explanation.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Start a Workflow using a Web Service

Exactly my problem! Thanks

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Start a Workflow using a Web Service

Hi!

You need to code your association Data before send it, therefore please do it in this way:

var associationData ="<Data><testComment>TEST123456</testComment></Data>";
associationData = htmlEscape(associationData);

function htmlEscape(str) {

    return String(str).replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');

}

Then just send your SOAP with the associationData tag already formatted:

...'<associationData>' +

associationData +

'</associationData>' +...

This should work! (tested on my side)

Best regards.

0 Kudos
Reply