SharePoint 2013 – CopyIntoItemsLocal is not returning any results

CopyIntoItemsLocal is not returning any results

I am using the /_vti_bin/Copy.asmx service to copy a file from one location to another location. My destination includes a number of folders ( yes I know folders is a bad idea).

To call the service I’m using Nintex, but the same issue could happen with other tools/code.

I specified a service account to connect to the service.

I created my soap:

<?xml version=”1.0″ encoding=”utf-8″?><br
<soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/”  xmlns:soap=”http://schemas.microsoft.com/sharepoint/soap/”    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”     xmlns:xsd=”http://www.w3.org/2001/XMLSchema”&gt;
<soapenv:Body>
<soap:CopyIntoItemsLocal>      <soap:SourceUrl>https://MyCorp.co.uk/practices/subsite/int/km/submission/TestDocument.txt</soap:SourceUrl&gt;
<soap:DestinationUrls>
<soap:string>https://MyCorp.co.uk/practices/subsite/int/km/newsubmission/SubFolder/AndAnotherFolder/TestDocument.txt</soap:string&gt;
</soap:DestinationUrls>
</soap:CopyIntoItemsLocal>
</soapenv:Body>
</soapenv:Envelope>

I am getting the right result back that I want:

<soap:Envelope xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:xsd=”http://www.w3.org/2001/XMLSchema”&gt;
<soap:Body>
<CopyIntoItemsLocalResponse xmlns=”http://schemas.microsoft.com/sharepoint/soap/”&gt;
<CopyIntoItemsLocalResult>0</CopyIntoItemsLocalResult>
<Results>
<CopyResult ErrorCode=”Success” DestinationUrl=”https://MyCorp.co.uk/practices/subsite/int/km/submissions/TestDocument.txt&#8221; />
</Results>
</CopyIntoItemsLocalResponse>
</soap:Body>
</soap:Envelope>

But the document isn’t copied … or is it?

I logged in as the service account and my file was there. Not checked in though!
One of the fields has some field validation specified and when the file is copied the validation fails. Rather than throwing an error (SharePoint, why can’t you error here, now that it would be useful?)

I gave the field a default value (so that the validation succeeds) and my document appears.

Avatar of Pieter Veenstra

Is your business still running on paper trails, sprawling Excel files, or ageing Access databases? There's a better way — and I can show you exactly what it looks like. I'm the Technical Director of Vantage 365, a Microsoft solutions consultancy working with clients across the UK, the Netherlands, and worldwide. For over 30 years I've been turning messy, manual business processes into clean, automated systems that save time, reduce errors, and give teams the visibility they need to make better decisions. SharePains is not just any blog run by a Microsoft MVP. Have you ever used Try-Catch in Power Automate? The original post about Try-Catch in Power Automate can still be found on this site, https://sharepains.com/2018/02/07/try-catch-finally-in-power-automate-flow/ Or have you ever used the Pieter’s method to avoid variables and speed up your flows? https://sharepains.com/2020/03/11/pieters-method-for-advanced-in-flows/ You can contact me using contact@sharepains.com

Related Posts

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains

Subscribe now to keep reading and get access to the full archive.

Continue reading