I got a work on moving a file from a document library using Web Service. I already work on this, but I did that with SharePoint Object model. Now I have to search for this about web service, oh… I had forgotten the Copy web service; it’s just announced in WSS3.0. This Web service plays the role of copying and moving documents with the field information. There are three classes to play this role,
Copy Provides methods for copying files between SharePoint sites or within a SharePoint site.
CopyResult Represents the result of a copy operation.
FiledInformation Provides properties that define a field associated with a document copied by using a Copy web service operation.
The three methods within Copy class do the job for us to move the files in Sharepoint libraries,
GetItem Generates a Byte array representation of a document that can be passed to the CopyIntoItems method to copy the document to a different server.
CopyIntoItems Copies a document represented by a Byte array to one or more locations on a server.
CopyIntoItemLocal Copies a document from one location on a server running Windows SharePoint Services to another location on the same server.
By using this method we can upload, download from different servers, local machines. In my coming posts, I’ll explain each method in deep.