I have two workflows, one which Fetches the attachment from a list and the other Adds the attachment to a list. Both use the Call Web Service Action. Both the actions use the same Stored Credential, which has Admin permissions over the Farm.
The above actions execute fine on the Test environment, but fails in cases on the Production environment.
During testing I have observed that if the attachment name has special characters like '(' or ')' or '-' etc. it fails to get the attachment and throws an error (401) Unauthorized.
Similarly, for adding an attachment, if the attachment name has special characters like '(' or ')' or '-' etc. It fails to add the attachment and throws an error (401) Unauthorized.
Also, if you already attached the same attachment and you try to attach it again, it gives the same error.
(http:<SITE URL>/_layouts/15/NintexWorkflow/preview.aspx?ListId=3f5ed032-eb26-44fc-9dbf-a01c59d8ff26&ItemId=141&InstanceId=f081fdd8-cc59-420f-a2a6-3994bfbe4703): Nintex.Workflow.NWActionExecutionException: Error returned from server: 401 UNAUTHORIZED ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at phM=.uxM=.vhM=(yhM= vxM=, String wBM=, SoapVersion wRM=, String whM=, String wxM=, Security xBM=, HttpWebRequest xRM=)
at phM=.uxM=.vBM=(yhM= vRM=)
at Nintex.Workflow.Activities.CallWebServiceActivity.Execute(ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
at System.Workflow.Runtime.Scheduler.Run() -
-- End of inner exception stack trace --- (Build:3150)
Can anyone help me with this. Is there any configuration that needs to be done on the server to resolve this.
Thanks in Advance.
Hi, Shyam Shinde. I'll try to put this question in my weekly community update if nobody lends a hand by Friday. That'll raise the profile a little bit and maybe get you some help. All the best! ~Frank
If you are using Nintex for SharePoint 2013, I would recommend you to use REST API queries. It is easier to use and there are less bugs.
To create an attachment to a list, you can use the following web request (you have to use Web request action with REST API, not Call web service) :
I've written a blog on SharePoint 2013 REST API which can help you : How to execute a REST API request with Nintex Workflow (for this web request you need a request digest and I've explained how to get it in this blog)
Here's the SP2013 REST API reference : https://msdn.microsoft.com/en-us/library/office/jj860569.aspx
Hope this helps