AnsweredAssumed Answered

Copy document from Library to list item as attachment

Question asked by chanteldup on Apr 6, 2018
Latest reply on Jun 22, 2018 by mohamed

Good Day,


I have seen many users on the Community asking about copying documents from a Library to a list item and found many helpful answers but still cannot get this action to work. I have a custom solution in my SharePoint environment which receives a mail in a Library and then extracts xml data which is then used to 1. create a list item and 2. save all attachments to a designated document library, from here we have a workflow which kicks off for approval. what I need to do now is copy the documents from the designated document library and attach them to the list item, for this I am using the Call Web Service action with AddAttachment method in a separate Workflow that runs on the document library. the problem is that I keep getting an error:


Workflow Status

Failed to invoke web service. Error returned from server: <soap:Fault xmlns:soap=""><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.

This is  my Call Web Service config


I have also found that if I make any changes to the text "<soap Envelope: xmlns:xsi="" xmlns:soap="" xmlns:m="">" then the Workflow will not publish stating that SOAP envelope is not valid XML even when changing back to the original value unless I remove envelope/ from this section:
xmlns:soap="", which then gives me this error:


Workflow Details

Failed to invoke web service. Error returned from server: <soap:Fault xmlns:soap=""><faultcode>soap:VersionMismatch</faultcode><faultstring>Possible SOAP version mismatch: Envelope namespace http://schemas.xmlsoap.


For reference I have also tried changing the m:attachment to <m:attachment>[FileData]</m:attachment> which has made no difference.


So what am I doing wrong here?