I have a list which has 3 workflows. In the end of the first workflow I am using a Webservice to call the next workflow.
I am receiving sometimes the below error in the Workflow.
Failed to invoke web service. Error returned from server: The remote server returned an error: (401) Unauthorized.
The error is happening sometimes.
- I have two front end servers
- When I am using one of the servers url inside the webservice, the issue will not happen
- When I am using the url of the application, the issue will happen sometimes.
Have you tried using the web service with your SharePoint site url? It shold work, you don't need to call using your application server as not all of the users have access to application server. And sending requests to WFE server does not cause any issues if the user has atleast "read" access to SharePoint site.
Now your error says 401 unauthorized. Can you check if your credentials have proper access on that list and list item to start the workflow? I'll suggest using a service account for running web services.