Hi,There is a txt file with 4-5 versions. I am trying to get the contents of the older version using the webservice API. Here I am hardcoding the UUID of a node in the lightWeightVersionStore store. See the code as below:public static void main(String[] args) throws Exception{
Store storeRef = new Store(StoreEnum.workspace, "lightWeightVersionStore");
String uuid = "d7e29d6c-2965-11db-9253-5f4da51af059";
String path = null;
//start Session
AuthenticationUtils.startSession("admin", "admin");
// Get the content service
ContentServiceSoapBindingStub contentService = WebServiceFactory.getContentService();
// Create a reference to the node to be read
Reference newContentReference = new Reference (storeRef,uuid,path);
// Read the newly added content from the respository
Content[] contents = contentService.read(
new Predicate(new Reference[]{newContentReference}, storeRef, null),
Constants.PROP_CONTENT);
//Print the file contents
System.out.println(ContentUtils.getContentAsString(contents[0]));
// End the session
AuthenticationUtils.endSession();
}But I keep getting the following error:Exception in thread "main" org.alfresco.webservice.util.WebServiceException: Unable to get content as string.
at org.alfresco.webservice.util.ContentUtils.getContentAsString(ContentUtils.java:87)
at ReadFile.readFile(ReadFile.java:52)
at ReadFile.main(ReadFile.java:30)
Caused by: java.net.MalformedURLException: no protocol: null?ticket=TICKET_87c3cdd6-296a-11db-9253-5f4da51af059
at java.net.URL.<init>(URL.java:567)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at org.alfresco.webservice.util.ContentUtils.getContentAsString(ContentUtils.java:75)
… 2 more
I think its able to locate the content, but while trying to read the contents it fails.Please let me know how to go about this. Is tehre anything wrong with the code?? Do I need to make some modifications??————————————Thanks, Manmeet Bhavsar