cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with WebServiceFactory.getRepositoryService()

lsreedhar
Champ in-the-making
Champ in-the-making
Hi,

Iam new to WebServices and Alfresco. Iam trying to use Web services client to add a file into the Alfresco and downloaded Web Services samples available on the Alfresco site
How ever when iam trying to compile SAMPLESBASE.java iam facing with following exception

cannot access org.apache.axis.client.Stub
WebServiceFactory.getRepositoryService().get(new Predicate(new Refer
ence[]{SAMPLE_FOLDER}, STORE, null));

I have followed following steps
1. Downloaded and Installed Alfresco server
2. Downloaded and added webservicesclient.jar into classpath
3. Downloaded and placed Webservicesclient.properties in tomcat\webapps\Alfresco
4. Downloaded and added Axis related libraries into the classpath

Request some one to thow some light in where iam going wrong and what steps am i missing in compiling and executing this class file.

Is it required to generate the clients for this class?

Please help me in resolving this problems

Thanks in Advance
Sreedhar
2 REPLIES 2

openpj
Elite Collaborator
Elite Collaborator
Before to invoke WebServiceFactory.getRepositoryService().get(…. you can try to add this snippet to specify the endpoint of webservice stub on the server instead of using properties file:

WebServiceFactory.setEndpointAddress(ALFRESCO_WS_SERVER_ENDPOINT);         
AuthenticationUtils.startSession(ALFRESCO_USERNAME, ALFRESCO_PASSWORD);
and then:

WebServiceFactory.getRepositoryService().get(….
etc….

I hope this can help you  :wink:

flopez
Champ in-the-making
Champ in-the-making
Hello there!

How could I do this:


WebServiceFactory.setEndpointAddress(ALFRESCO_WS_SERVER_ENDPOINT);         
AuthenticationUtils.startSession(ALFRESCO_USERNAME, ALFRESCO_PASSWORD);

without having to hardcode the alfresco user and password, but using the currently logged user's session? (say my java class is used in a java backed webscript)

Please help!