As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
package com.nk.fmc.stars.test; import java.rmi.RemoteException; import junit.framework.Assert; import junit.framework.TestCase; import org.alfresco.webservice.authentication.AuthenticationServiceLocator; import org.alfresco.webservice.authentication.AuthenticationServiceSoapBindingStub; import org.alfresco.webservice.classification.ClassificationServiceSoapBindingStub; import org.alfresco.webservice.content.ContentServiceSoapBindingStub; import org.alfresco.webservice.repository.QueryResult; import org.alfresco.webservice.repository.RepositoryFault; import org.alfresco.webservice.repository.RepositoryServiceSoapBindingStub; import org.alfresco.webservice.repository.UpdateResult; import org.alfresco.webservice.types.CML; import org.alfresco.webservice.types.CMLCreate; import org.alfresco.webservice.types.NamedValue; import org.alfresco.webservice.types.ParentReference; import org.alfresco.webservice.types.Query; import org.alfresco.webservice.types.Reference; import org.alfresco.webservice.types.ResultSet; import org.alfresco.webservice.types.ResultSetRow; import org.alfresco.webservice.types.Store; import org.alfresco.webservice.util.AuthenticationUtils; import org.alfresco.webservice.util.Constants; import org.alfresco.webservice.util.Utils; import org.alfresco.webservice.util.WebServiceFactory; import org.hibernate.SessionFactory; import org.nkics.contentretrieval.ContentRetriever; import org.nkics.contentretrieval.ContentRetrieverImpl; import org.nkics.contentretrieval.AlfrescoWSImpl.AlfrescoWebServiceContentTransformer; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; public class LoadTestQuery extends TestCase { Store STORE = null; RepositoryServiceSoapBindingStub repository; ContentServiceSoapBindingStub content; ClassificationServiceSoapBindingStub classification; private static final String REF_TEXT1 = "/*[@cm:name=\""; private static final String REF_TEXT2 = "\"]"; private static final String NODE_REF = "workspace://SpacesStore/"; protected void setUp() throws Exception { super.setUp(); AuthenticationUtils.startSession("admin", "admin"); AuthenticationServiceSoapBindingStub authenticationService = (AuthenticationServiceSoapBindingStub)new AuthenticationServiceLocator().getAuthenticationService(); //AuthenticationResult result = authenticationService.startSession("admin", "admin"); // ticket = result.getTicket(); STORE = new Store(Constants.WORKSPACE_STORE, "SpacesStore"); repository = WebServiceFactory .getRepositoryService(); content = WebServiceFactory .getContentService(); classification = WebServiceFactory .getClassificationService(); } public void testCategoriesSearch() throws Exception { for (int x= 0; x<500; x++) { //Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"/cm:generalclassifiable//cm:Regions\""); Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"/cm:generalclassifiable//cm:Eastern_x0020_Asia\""); //Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"/cm:generalclassifiable//cm:AK\""); QueryResult result = repository.query(STORE, query, true); ResultSet rs = result.getResultSet(); ResultSetRow[] rows = rs.getRows(); for (ResultSetRow row : rows) { System.out.println("UID: "+ row.getNode().getId()); System.out.println("Type: "+ row.getNode().getType()); NamedValue[] values = row.getColumns(); System.out.println("Properties: "); for (NamedValue col : values) { System.out.println("\tName: " + col.getName()); System.out.println("\tValue: " + col.getValue()); } } } } protected void tearDown() throws Exception { AuthenticationUtils.endSession(); super.tearDown(); } }
Hi,This has been fixed now.The authentication service returns the session id back with the user name and ticket. This can then be passed on subsequent requests as a cookie allowing Tomcat to reuse the same session.The client libraries have been updated to this this automatically.Cheers,Roy
Hi,Are you using the Alfresco java web service client library or are you doing things yourself?I presume you are using Java to access the web services?Cheers,Roy