Hi
When i try to invoke the UploadContent Method to upload a document to the content server using .NET client, i get the following error:
{"Dispatched service DocumentManagement threw exception DocMan.Error : Error adding version to 'New Document.txt'."} System.Exception {System.ServiceModel.FaultException}
Below is the source code for the same, can anyone help me with this please.
AuthenticationLab46.AuthenticationClient authClient = new AuthenticationClient();DocumentManagementClient dm = new DocumentManagementClient();ContentServiceClient cs = new ContentServiceClient();OTAuthentication dmOTauth = new TestWSConnection.DMLab46.OTAuthentication();OTAuthentication csOTauth = new TestWSConnection.ContentServiceLab46.OTAuthentication();try{
dmOTauth.AuthenticationToken = token;
csOTauth.AuthenticationToken = token;
DMLab46.
ContentServiceLab46.
fa.CreatedDate = fi.CreationTime;
fa.ModifiedDate = fi.LastWriteTime;
fa.FileName = fi.Name;
fa.FileSize = fi.Length;
}
{
}
string token = authClient.AuthenticateUser("Admin", "livelink");int parentID = 2000;string name = "New Document.txt";string comment = "Uploaded through the EWS DocumentManagement web service.";bool advancedVersionControl = false;Metadata docMetadata = null;string context = dm.CreateDocumentContext(dmOTauth, parentID, name, comment, advancedVersionControl, docMetadata);string filePath = @C:\TEST.txt;FileInfo fi = new FileInfo(filePath);FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);FileAtts fa = new FileAtts();string objectID = cs.UploadContent(csOTauth, context, fa, fs);Console.WriteLine("Uploaded Document ID = " + objectID);Console.Read();catch (Exception ex)Console.WriteLine(ex.StackTrace);Console.Read();
DMLab46.
ContentServiceLab46.
DMLab46.
ContentServiceLab46.