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

Workflow Call Web Service - Works on Run Now but not in workflow

Jump to solution

Hello,

 

I appreciate your assistance in the below.

 

A simple web service to get the PreferredName of the account using either SharePoint UserGroup.asmx service or REST and both are not working.

Whenever I try the Run Now, I get the results as expected. When running the instance the first (UserGroup.asmx) results in 401 Unauthorized. The second (REST)provides a completely different XML without the user profile properties.

Please find attached the screens for the configuration and the results.

 

1.png

 

 

 

 

 

 

 

results in 401 unauthorized in a workflow context.

Failed to invoke web service. Error returned from server: 401 UNAUTHORIZED

 

2.png

 

 

 

 

 

 

 

The returned xml is only this part that doesn't include the user information.

 

<?xml version="1.0" encoding="utf-8"?><d:GetPropertiesFor xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:null="true" />

 

The workflow runs in the context of the user who published the workflow and is also a site admin same as the username specified for the webservices.

 

Appreciate any insight and thank you in advance!

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

Re: Workflow Call Web Service - Works on Run Now but not in workflow

Jump to solution

@zeet .....Is there a reason you're not using query user profile or set variable action instead?

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Workflow Call Web Service - Works on Run Now but not in workflow

Jump to solution
Are you referring to the Quey LADP? If yes, the reason is that there is more than one source that we get the user Information from and it synched back to the SharePoint farm. Accordingly, I can't use it.
0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Workflow Call Web Service - Works on Run Now but not in workflow

Jump to solution

@zeet ....I'm talking about Query User Profile and you can also use Set Variable action. Since your user information have multiple source but it does gets sync with SP farm using User Profile Service Application which means either action will be able to work for you.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Workflow Call Web Service - Works on Run Now but not in workflow

Jump to solution

Thank you @kunalpatel  but for some reason, there is no Query User Profile

3.png

0 Kudos
Reply
Highlighted
Nintex Employee
Nintex Employee

Re: Workflow Call Web Service - Works on Run Now but not in workflow

Jump to solution
Hi,

The Query User Profile action is only available in the Enterprise edition of Nintex workflow.

Back to the original issue.
The run now is just a a way of quickly testing but the action does not behave exactly the same way when run from a workflow.
In essence you are executing the action from your machines web browser and the workflow is executing the command from the Web front end. There can be differences in trust and authentication.
0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Workflow Call Web Service - Works on Run Now but not in workflow

Jump to solution

@zeet ....did you try set variable action?

View solution in original post

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Workflow Call Web Service - Works on Run Now but not in workflow

Jump to solution
Thanks, yes it works!
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Workflow Call Web Service - Works on Run Now but not in workflow

Jump to solution
Thanks for the clarification!
0 Kudos
Reply