C# – Transfer files with versioning using SharePoint and SOAP

csharepointsoap

I'm writing a .Net C# application that will make SOAP calls to a configured SharePoint database, based on certain triggers from another SQL database.

I have a problem where I need to transfer documents from a folder within a list to another folder in a different list. Each document will have version history enabled, which I am required not to lose in the transfer.

SOAP is the best way for me to interact with SharePoint, but if it can be done easily by another method from within my C# environment I'm willing to look into it.

Extra points if someone has a way to move an entire folder and contents from one list to another, without losing document histories etc.

Thanks


Edit:

I've looked into the Copy webservice, and can move files individually between lists that support versioning, but unfortunately the source file's versioning isn't replicated.
Code below if anyone's interested

CopyWebReference.Copy copyservice = new CopyWebReference.Copy();
copyservice.Credentials = System.Net.CredentialCache.DefaultCredentials;

CopyWebReference.CopyResult[] results = { new CopyWebReference.CopyResult() };

uint ret = copyservice.CopyIntoItemsLocal(source, new string[] { dest }, out results);

I'm currently looking into using the Sites.ExportWeb and ImportWeb to re-parent an entire folder, I've asked another question about this elsewhere, has anyone had any success with either of these methods?

Best Answer

Have you thought about using WebDAV? Should be a simple operation with the MOVE command

Related Topic