1 17 package org.alfresco.webservice.sample; 18 19 import org.alfresco.webservice.repository.RepositoryServiceSoapBindingStub; 20 import org.alfresco.webservice.types.Store; 21 import org.alfresco.webservice.util.AuthenticationUtils; 22 import org.alfresco.webservice.util.WebServiceFactory; 23 24 31 public class WebServiceSample1 extends WebServiceSampleBase 32 { 33 38 public static void main(String [] args) 39 throws Exception 40 { 41 AuthenticationUtils.startSession(USERNAME, PASSWORD); 43 44 try 45 { 46 RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService(); 48 49 Store[] stores = repositoryService.getStores(); 51 if (stores == null) 52 { 53 System.out.println("There are no stores avilable in the repository."); 55 } 56 else 57 { 58 System.out.println("The following stores are available in the repository:"); 60 for (Store store : stores) 61 { 62 System.out.println(store.getAddress()); 63 } 64 } 65 } 66 finally 67 { 68 AuthenticationUtils.endSession(); 70 } 71 } 72 } 73 | Popular Tags |