Hi All,
I am trying to implement versioning for ECM documents using OpenText livelink Java api.
I upload a document(w1.txt) to ECM successfully using 'contentServiceClient.uploadContent(new DataHandler(new FileDataSource(filePath)))'
I checked the document in the ECM server, and versioning is enabled for this document. Also I could add new versions of this document(w1.txt) directly from the ECM server.
Also I am able to get the NodeVersionInfo() and VersionNum() of this document correctly from java.
But, when I upload the next version of the document (by the same file name to the same location) from the Java, I am getting "DocMan.DuplicateName : An item with the name 'w1.txt' already exists."
I tried to pass along the version indicator in the SOAP header as below:
String versionContextID = docManClient.addVersionContext(docManClient.getNodeByName(parentID, fileName).getID(), null);
// Create a SOAP header
SOAPHeader header = MessageFactory.newInstance().createMessage().getSOAPPart().getEnvelope().getHeader();
// Add the Version ContextID SOAP header element
SOAPHeaderElement verContextIDElement = header.addHeaderElement(new QName(CORE_NAMESPACE, "versionContextID"));
verContextIDElement.addTextNode(versionContextID);
List<Header> headers = new ArrayList<Header>();
headers.add(Headers.create(verContextIDElement));
((WSBindingProvider) contentServiceClient).setOutboundHeaders(headers);
But this didn't solve the problem, still getting 'Duplicate item' error (I am adding other headers like 'OTAuthentication' and 'AuthenticationToken', in the same above manner which are working well)
Appreciate if somebody throws some light on this.
Thanks,
Dhanya
I am trying to implement versioning for ECM documents using OpenText livelink Java api.
I upload a document(w1.txt) to ECM successfully using 'contentServiceClient.uploadContent(new DataHandler(new FileDataSource(filePath)))'
I checked the document in the ECM server, and versioning is enabled for this document. Also I could add new versions of this document(w1.txt) directly from the ECM server.
Also I am able to get the NodeVersionInfo() and VersionNum() of this document correctly from java.
But, when I upload the next version of the document (by the same file name to the same location) from the Java, I am getting "DocMan.DuplicateName : An item with the name 'w1.txt' already exists."
I tried to pass along the version indicator in the SOAP header as below:
String versionContextID = docManClient.addVersionContext(docManClient.getNodeByName(parentID, fileName).getID(), null);
// Create a SOAP header
SOAPHeader header = MessageFactory.newInstance().createMessage().getSOAPPart().getEnvelope().getHeader();
// Add the Version ContextID SOAP header element
SOAPHeaderElement verContextIDElement = header.addHeaderElement(new QName(CORE_NAMESPACE, "versionContextID"));
verContextIDElement.addTextNode(versionContextID);
List<Header> headers = new ArrayList<Header>();
headers.add(Headers.create(verContextIDElement));
((WSBindingProvider) contentServiceClient).setOutboundHeaders(headers);
But this didn't solve the problem, still getting 'Duplicate item' error (I am adding other headers like 'OTAuthentication' and 'AuthenticationToken', in the same above manner which are working well)
Appreciate if somebody throws some light on this.
Thanks,
Dhanya