Skip to main content
Nintex Community Menu Bar

Hello All,

 

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.

 

                    Fetch Attachment                                                                                                                                    

                 138250_pastedImage_0.png        

 

                  Add Attachment

               138367_pastedImage_2.png

The above actions execute fine on the Test environment, but fails in cases on the Production environment.

 

Fetch Attachment

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.

 

Add Attachment

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.

Is it possible to use AddAttachment web service in Workflow Tasks?

 

Error Log:

 

(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 System.Net.HttpWebRequest.GetResponse() 

at System.Net.HttpWebRequest.GetResponse() 

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.

 

Regards,

Shyam

Can anyone help me with this!!!

Regards,

Shyam


Thank you Frank Field​ for your support.

Regards,

Shyam


Hi Shyam,

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) :

Web URL/_api/web/lists/getbytitle('List title')/items(Item ID)/AttachmentFiles/add(FileName='txtCurrentAttachmentFileName')

(https://msdn.microsoft.com/EN-US/library/office/dn450841.aspx#bk_FileCollectionAdd)

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


Reply