Nintex Connect

The Official Community Site for Nintex Software Products, including Nintex Workflow 2007, 2010 and 2013; Nintex Workflow for Project Server 2010; Nintex Reporting 2008 and Nintex Analytics 2010; Nintex Forms 2010; Nintex Live and Nintex SmartLibrary.
Welcome to Nintex Connect Sign in | Join | Help
in Search

Call Web Service: Attaching a file from a Document Library to a List

Last post 12-25-2009, 11:04 AM by Anonymous. 0 replies.
Sort Posts: Previous Next
  •  12-25-2009, 11:04 AM 8036

    Call Web Service: Attaching a file from a Document Library to a List

    You can use the Microsoft Web service http://msdn.microsoft.com/en-us/library/lists.lists.addattachment.aspx to attach the current file the workflow is running on to a list item within the list specified in the Web service SOAP configuration.

    Example

    Below is a List with one item and no attachment



    Below is a screenshot of the Shared Documents library containing the item to attach to the list:



    Here we are creating a workflow on the Shared Documents library with a "Call Web Service" action configured as follows:



    In this example the listName and listItemID are the ID and List Name of the target item where you would like the attachment added.

    SOAP Example

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
         <soap:Body>
             <AddAttachment xmlns="http://schemas.microsoft.com/sharepoint/soap/">
                 <listName>CAS-06699-LRR5</listName>
                 <listItemID>1</listItemID>
                 <fileName>{ItemProperty:FileLeafRef}</fileName>
                 <attachment>[FileData]</attachment>
             </AddAttachment>
         </soap:Body>
    </soap:Envelope>


    Where {ItemProperty:FileLeafRef} is the document name inserted reference and [FileData] is the file byte array parameter.



    Go here to see more tutorials on other examples of the "Call Web Service" action - http://connect.nintex.com/files/folders/tutorials/tags/web+service/default.aspx.




View as RSS news feed in XML
Powered by Community Server, by Telligent Systems