Skip to main content

I have been trying out the "CopyIntoItemsLocal" webservice call from a "Web Request" action in Nintex Workflow for Office 365 this afternoon (it's preferable over the Copy Document action, because you can change the filename at the same time as copying).

 

With a very simple test system, with libraries "Source Library", and "Destination Library", the call is failing, and I have no idea why (and of course there is no ULS log in 365 to look at).

 

Here is a sample of the XML being submitted (using Soap 1.2 in this case)

 

<?xml version="1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"><soap12:Body><CopyIntoItemsLocal xmlns="http://schemas.microsoft.com/sharepoint/soap/"><SourceUrl>https://foo.sharepoint.com/test/Source%20Library/test.txt</SourceUrl><DestinationUrls><string>https://foo.sharepoint.com/test/Destination%20Library/test.txt</string></DestinationUrls></CopyIntoItemsLocal></soap12:Body></soap12:Envelope>

 

It always returns the following (highlighted for clarity):

 

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><CopyIntoItemsLocalResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/"><CopyIntoItemsLocalResult>0</CopyIntoItemsLocalResult><Results><CopyResult ErrorCode="Unknown" ErrorMessage="Value does not fall within the expected range." DestinationUrl="https://foo.sharepoint.com/test/Destination%20Library/test.txt" /></Results></CopyIntoItemsLocalResponse></soap:Body></soap:Envelope>

 

I'm just wondering if anybody else has successfully called the Copy webservice from SharePoint Online.

Just out of interest, I tried the same XML call this morning in an on-premises SharePoint virtual machine, and it failed too - so I used the query builder in Nintex Workflow for SharePoint 2013 (on-premises), which turned out the following XML (obviously I sanitised it before posting it):

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://schemas.microsoft.com/sharepoint/soap/">
<soap:Header>
</soap:Header>
<soap:Body>
<m:CopyIntoItemsLocal>
<m:SourceUrl>https://foo.sharepoint.com/test/Source%20Library/test.txt</m:SourceUrl>
<m:DestinationUrls>
<m:string>https://foo.sharepoint.com/test/Destination%20Library/test.txt</m:string>
</m:DestinationUrls>
</m:CopyIntoItemsLocal>
</soap:Body>
</soap:Envelope>

I verified this in a SOAP1.1 web request in the on-premises version - it works perfectly.

However - if I use the same XML in a SOAP1.1 web request in Nintex Workflow for Office 365, it fails with the same result as previously:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<CopyIntoItemsLocalResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<CopyIntoItemsLocalResult>0</CopyIntoItemsLocalResult>
<Results>
<CopyResult ErrorCode="Unknown" ErrorMessage="Value does not fall within the expected range." DestinationUrl="https://foo.sharepoint.com/test/Destination%20Library/test.txt" />
</Results>
</CopyIntoItemsLocalResponse>
</soap:Body>
</soap:Envelope>

At this point I'm kind of running out of ideas...


‌ have you found a solution?

Regards,

Tomasz


Hi Tomasz,

The only solution I found was to use the REST interface - which is quite a bit more complex because you need to make a call to ContextInfo first, then parse the Digest from it, build custom headers for a POST, and finally call the WebService.

Interestingly, there is another method - using "Upload Document" - but it's really slow - perhaps 1 document per minute. Upload Document can actually upload an existing document (already in SharePoint) to another location in SharePoint.


Hi!

Just to your knowledge - if the file you are trying to upload using this SOAP method contains any binary data (ex. is not a plain text file), then this will not work  I recently found out that neither "HTTP Web Request" nor "Call webservice" actions does allow to put binary data as a variable.

No matter whether you provide it as a variable, or set is as "Current file" (in case of the "Call webservice") - the data that is sent is somehow changed (I suspect Nintex actions does not support "null" bytes and are cutting them off). I had no problems in executing the SOAP/ REST actions for uploading binaries using SOAP UI, Postman, Fiddler - but via Nintex Workflow it always was a failure...

I had even created a uservoice ticket here: https://nintex.uservoice.com/forums/218291-3-nintex-workflow-for-office-365/suggestions/18003859-ability-to-store-binary-data-in-variables-and-pass.

So if you have any success in this problem, please post a follow up

Regards,

Tomasz


Reply