02-05-2007 03:46 PM
02-06-2007 05:28 AM
02-06-2007 11:15 AM
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();
}
}
02-07-2007 06:17 AM
02-08-2007 06:13 AM
10-09-2007 06:51 AM
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
10-10-2007 09:46 AM
10-10-2007 12:20 PM
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
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.