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

  • 3 February 2020
  • 8 replies
  • 70 views

Badge +1

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.

 

6350iD4C9FE3C203AA549.png

 

 

 

 

 

 

 

results in 401 unauthorized in a workflow context.

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

 

6349iEF2B11AB9390E405.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!


8 replies

Badge +12

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

Badge +1
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.
Badge +12

@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.

Badge +1

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

6352i0A176B069CE2FA2F.png

Userlevel 6
Badge +22
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.
Badge +12

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

Badge +1
Thanks, yes it works!
Badge +1
Thanks for the clarification!

Reply