Hi,
I have a SharePoint Nintex 2010 workflow activity on a item in a document library that send a metadata and document data to a web service. The metadata is going through correctly, but I am having problem sending the document data/content. Any help will be greatly appreciated
Web method: UploadDocument
Soap editior (content):
<?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>
<UploadDocument xmlns="http://WebService/1.0.0
<request>
<Id>{ItemProperty:ID}</Id>
<Name>{ItemProperty:FileLeafRef}</Name>
<Modified>{ItemProperty:Modified}</Modified>
<Metadata>
<Attribute>
<Key>Title</Key>
<Value>{ItemProperty:Title}</Value>
</Attribute>
<Attribute>
<Key>Group</Key>
<Value>{ItemProperty:Group}</Value>
</Attribute>
<Attribute>
<Key>Document Type</Key>
<Value>Other</Value>
</Attribute>
</Metadata>
<Data>[FileData]</Data>
</request>
</UploadDocument>
</soap:Body>
</soap:Envelope>
---------------------
I am not sure how to include file content between the tags <Data></Data>.
Thanks,
Abraham
Where is the FileData coming from? How is it retrieved? Is this the entire file contents, or just data fields within the file?
FileData is the entire content of the file. I need to retrieve the file content and assign it to a variable FileData.
Well from the userguide documentation, To pass the byte array of the document under workflow, type [FileData] into any input field. At runtime Nintex Workflow will base64 encode the file and pass that as the value.
This can be used in Call a Web Service or Web Request actions. Can your webservice take the base64 encoding? This may be were your issue lies.
There is a previous post similar to this, Is it possible to use a Nintex workflow in SharePoint to copy/move an attachment from an item in lis...
And Vadim's answer seemed to make the difference using a combination of actions. I was unable to check on his website to summarize the solution here, but was unable to see the site at the moment.
The web service that I wrote accept a byte [] for the file as argument.
I use the [FileData] in the workflow; the Nintex workflow will convert the file to base64 and send it to the web service. Now my web service accept the file as a byte[]. Do you think this is the problem? Do I need to change the byte[] to string?
Thanks
I don't believe it is a byte array, have you tried as an encoded string? I wasn't able to find the detail specs though. Vadim Tabakman, do you know if it is a byte array?
It is working now. The problem was with the back end web service. I use a byte array for the document content in the web service and [FileData] in the workflow. Thanks for your reply.
That's great! Thank you for the response. Mark my response as an answer if it was a help.