Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you use the CopyIntoItems method of the SharePoint Copy web service?
    text
    copied!<p>I am attempting to load document files into a document library in SharePoint using the CopyIntoItems method of the SharePoint Copy web service.</p> <p>The code below executes and returns 0 (success). Also, the CopyResult[] array returns 1 value with a "Success" result. However, I cannot find the document anywhere in the library.</p> <p>I have two questions:</p> <ol> <li>Can anyone see anything wrong with my code or suggest changes?</li> <li>Can anyone suggest how I could debug this on the server side. I don't have a tremendous amount of experience with SharePoint. If I can track what is going on through logging or some other method on the server side it may help me figure out what is going on.</li> </ol> <p><strong>Code Sample:</strong></p> <pre><code>string[] destinationUrls = { Uri.EscapeDataString("https://someaddress.com/Reports/Temp") }; SPCopyWebService.FieldInformation i1 = new SPCopyWebService.FieldInformation { DisplayName = "Name", InternalName = "Name", Type = SPListTransferSpike1.SPCopyWebService.FieldType.Text, Value = "Test1Name" }; SPCopyWebService.FieldInformation i2 = new SPCopyWebService.FieldInformation { DisplayName = "Title", InternalName = "Title", Type = SPListTransferSpike1.SPCopyWebService.FieldType.Text, Value = "Test1Title" }; SPCopyWebService.FieldInformation[] info = { i1, i2 }; SPCopyWebService.CopyResult[] result; byte[] data = File.ReadAllBytes("C:\\SomePath\\Test1Data.txt"); uint ret = SPCopyNew.CopyIntoItems("", destinationUrls, info, data, out result); </code></pre> <p><strong>Edit that got things working:</strong></p> <p>I got my code working by adding "<a href="http://null" rel="nofollow noreferrer">http://null</a>" to the SourceUrl field. Nat's answer below would probably work for that reason. Here is the line I changed to get it working.</p> <pre><code>// Change uint ret = SPCopyNew.CopyIntoItems("http://null", destinationUrls, info, data, out result); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload