02-22-2010 04:35 PM
import org.alfresco.webservice.content.Content;
import org.alfresco.webservice.content.ContentServiceSoapBindingStub;
import org.alfresco.webservice.types.Predicate;
import org.alfresco.webservice.types.Reference;
import org.alfresco.webservice.types.Store;
import org.alfresco.webservice.util.AuthenticationUtils;
import org.alfresco.webservice.util.Constants;
import org.alfresco.webservice.util.WebServiceFactory;
public class WebServiceClientArchiver
{
public WebServiceClientArchiver() {
super();
// TODO Auto-generated constructor stub
}
public static void main(String args[])throws Exception
{
// Start the session
AuthenticationUtils.startSession("admin", "admin");
try
{
Store storeRef = new Store(Constants.WORKSPACE_STORE, "SpacesStore");
Reference reference = new Reference(storeRef,null,"/app:company_home/cm:JeanPaul");
ContentServiceSoapBindingStub contentService = WebServiceFactory.getContentService();
Content[] readResult = contentService.read(new Predicate(new Reference[]{reference}, storeRef, null), Constants.PROP_CONTENT);
Content content = readResult[1];
System.out.println(content.toString());
//System.out.println(ContentUtils.getContentAsString(content));
}
catch(Throwable e)
{
System.out.println(e.toString());
}
finally
{
// End the session
AuthenticationUtils.endSession();
}
}
}
02-26-2010 08:36 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.