cancel
Showing results for 
Search instead for 
Did you mean: 

web Services

hadabechir_4088
Champ in-the-making
Champ in-the-making
Bonjour,
Je travail  avec les web services, je veux implementer une methode qui se connecte au repository et lit les "Content" qui existent dans un espace donné, mais j'ai pas réussit. Voila le code que j'ai ecrit, je sait qu'il manque quelques choses mais je ne sait pas quoi exactement :
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();
        }
    }
       
}
1 REPLY 1
Getting started

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.