RajaneeshJM
Programmer
Hi,
I am writing a Java program to add a document to Livelink using webservices. I am using the DocumentManagement webservice. Below is the uploadFile method which accepts DocumentManagement dm as a parameter
private static void uploadFile(DocumentManagement dm, String admToken) {
String name = "TestLivelink.docx";
String comment = "Uploaded through the Web Service";
boolean advancedVersionControl = true;
Metadata metadata = null;
int parentID = 2000;
String contextId;
String filePath = "E:/Livelink/TestUpload/TestLivelink.docx";
try{
File file = new File(filePath);
Attachment atch = new Attachment();
atch.setContents(getByteArray(file));
atch.setFileName(file.getName());
atch.setFileSize(file.getTotalSpace());
atch.setCreatedDate(getXMLGregorianCalendar(new Date(file.lastModified())));
atch.setModifiedDate(getXMLGregorianCalendar(new Date(file.lastModified())));
Node node = dm.createDocument(parentID, name, comment, true, metadata, atch);
System.out.println("node id:"+node.getID());
}catch(Exception e){
System.out.println("Error:"+e.getMessage());
}
}
On execution I encounter the below exception
javax.xml.ws.soap.SOAPFaultException: Error adding version to 'TestRJM.docx'. Error reading data stream from version. [E682033159]
Request you to help me resolve the issue.
Regards
Rajaneesh JM
I am writing a Java program to add a document to Livelink using webservices. I am using the DocumentManagement webservice. Below is the uploadFile method which accepts DocumentManagement dm as a parameter
private static void uploadFile(DocumentManagement dm, String admToken) {
String name = "TestLivelink.docx";
String comment = "Uploaded through the Web Service";
boolean advancedVersionControl = true;
Metadata metadata = null;
int parentID = 2000;
String contextId;
String filePath = "E:/Livelink/TestUpload/TestLivelink.docx";
try{
File file = new File(filePath);
Attachment atch = new Attachment();
atch.setContents(getByteArray(file));
atch.setFileName(file.getName());
atch.setFileSize(file.getTotalSpace());
atch.setCreatedDate(getXMLGregorianCalendar(new Date(file.lastModified())));
atch.setModifiedDate(getXMLGregorianCalendar(new Date(file.lastModified())));
Node node = dm.createDocument(parentID, name, comment, true, metadata, atch);
System.out.println("node id:"+node.getID());
}catch(Exception e){
System.out.println("Error:"+e.getMessage());
}
}
On execution I encounter the below exception
javax.xml.ws.soap.SOAPFaultException: Error adding version to 'TestRJM.docx'. Error reading data stream from version. [E682033159]
Request you to help me resolve the issue.
Regards
Rajaneesh JM