cancel
Showing results for 
Search instead for 
Did you mean: 

Need Help to access alfresco loacalhost:8080/services/cmis through android app.

malitha
Champ in-the-making
Champ in-the-making
hi, I'm new to alfresco and I need ur help to access localhost:8080/alfresco/services/cmis through my android app in emulator. I tried this sample code shown below and got a error. Pls help me … any help appreciated.

protected String doInBackground(String… params) {
Log.d(TAG, "doInBackground");
Log.d(TAG, params[0] + ":" + params[1] + ":" + params[2]);
String url = params[0];
String username = params[1];
String password = params[2];
// HelloRepo
try {
   
   // connect to on-premise repo
   RepositorySession session =  RepositorySession.connect(url,   username, password);
   
   if (session != null) {
   // Get some repository information
   Log.d(TAG, "baseUrl: " + session.getBaseUrl());
   Log.d(TAG, "rootFolder: "
   + session.getRootFolder().getName());
   // Obtain a repository information object
   RepositoryInfo repoInfo =
   session.getRepositoryInfo();
   Log.d(TAG, "repoId: " + repoInfo.getIdentifier());
   Log.d(TAG, "repoName: " + repoInfo.getName());
   Log.d(TAG, "repoDescription: " +
   repoInfo.getDescription());
   Log.d(TAG, "repoVersion: " + repoInfo.getVersion());
   Log.d(TAG, "repoEdition: " + repoInfo.getEdition());
   // Get site service

GOT THE ERROR ….
Failed to connect: org.alfresco.mobile.android.api.exceptions.AlfrescoSessionException: org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Cannot access http://localhost:8080/alfresco/service/cmis: Permission denied

Near "RepositorySession session =  RepositorySession.connect(url,   username, password);" this code.
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
What is that RepositorySession class? I do not recognize it from Apache Chemistry OpenCMIS.

Also, if you are using Alfresco 4.x or higher, please use http://localhost:8080/alfresco/cmisatom. The URL you are using is deprecated.

Last, we can hopefully solve your problem without it, but in case you are interested, there is a book from Manning called Apache Chemistry and CMIS in Action, and it has a section on using CMIS from Android, including a sample app.

Jeff

malitha
Champ in-the-making
Champ in-the-making
Thank you very much jeff, for helping me.
Actually  RepositorySession class is taken from a sample application about android alfrsco. I think this RepositorySession class is in Alfresco libraries. not in appache chemistry.

the url http://localhost:8080/services/cmis also taken from the book where that sample app is taken from. here is the link (https://www.alfresco.com/cmis/browser?id=workspace%3A//SpacesStore/76fdddfc-74ad-49e1-8a72-a742083e3...). I'll try using the url you have given. may be my previous link (deprecated url)is the problem. Thnaks again . pls comment about the e-book that I'm referring for alfrsco mobile(https://www.alfresco.com/cmis/browser?id=workspace%3A//SpacesStore/76fdddfc-74ad-49e1-8a72-a742083e3...).

Cheers !
Malitha.