I'm trying to copy a list item into folder in a document library.
I have used the "Lists.asmx" webservice for it and the "UpdateListItems" webmethod.
Below is my XML, I have used a "FileDirRef" to provide the folder under which I need to copy the item.
But the item is been copied outside the folder at the library level.
<Batch OnError="Continue" ListVersion="1" ViewName="">
<Method ID="1" Cmd="New">
<Field Name="FileDirRef">[Site URL]/Sites/C0001968/Archival List/18-May-2015</Field>
Can someone please tell where I'm going wrong.
Thanks in Advance
Have you considered using the copy.asmx web service instead? You can find more information regarding this web service here: Copy.CopyIntoItems Method (Copy).
Try using the CopyIntoItems Method instead and see if you have more success.
I have tried using "Copy.asmx" webservice and the CopyIntoItems method.
<m:FieldInformation Type="Text" DisplayName="er" Value="Test"></m:FieldInformation>
But, I'm getting an error,
<CopyResult ErrorCode="Unknown" ErrorMessage="A file with the name Archival List/18-May-2015 already exists. It was last modified by i:0#.w|common\ssh6626 on 18 mei 2015 09:13:49 +0200." DestinationUrl="[Site URL]/Sites/C0001968/Archival%20List/18-May-2015" />
Could you please help me with this.
Thanks in Advance.
According to your XML it looks like you are providing the wrong URL in two places:
-Change this to reflect the file you are trying to copy. For example /ppv%20list/file.txt
-With this syntax you are trying to create the item "18-may-2015". Try adding the file name to the end of the URL ie. /C0001968/Archival%20List/18-May-2015/item.txt
Ensure that your site URL's include the file name when you're configuring your web service. I have written an example web service call with 'copyintoitems' below that you can use to get a better idea of how to configure your request:
<?xml version="1.0" encoding="utf-16"?>
<FieldInformation Type="URL" DisplayName="test" InternalName="test" Id="00000000-0000-0000-0000-000000000000" Value="" />
I configured this call using "web service studio" found here: WebServiceStudio - Home