c# - GetRepositories(parameters) throws CmisRuntimeException -
hi everyone,
i'm trying connect alfresco (dms), using dotcmis/c#, can create/locate/retrieve/archive files through program.
reference: https://chemistry.apache.org/dotnet/getting-started-with-dotcmis.html
note: tried different "atompuburl" test url might work.
[cmis v1.0]
alfresco version 3.x: http://[host]:[port]/alfresco/service/cmis
alfresco 4.0.x , alfresco 4.1.x : http://[host]:[port]/alfresco/cmisatom
alfresco 4.2: http://[host]:[port]/alfresco/api/-default-/public/cmis/versions/1.0/atom
[cmis v1.1]
alfresco 4.2: http://[host]:[port]/alfresco/api/-default-/public/cmis/versions/1.1/atom
here's code:
dictionary<string, string> parameters = new dictionary<string, string>();
parameters[dotcmis.sessionparameter.bindingtype] = bindingtype.atompub;
//parameters[dotcmis.sessionparameter.atompuburl] = "http://localhost:8080/alfresco/service/cmis";
//throws: "not found
//parameters[dotcmis.sessionparameter.atompuburl] = "http://localhost:8080/alfresco/cmisatom";
//throws: "unauthorized
//parameters[dotcmis.sessionparameter.atompuburl] = "http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom";
//throws: "unauthorized
//parameters[dotcmis.sessionparameter.atompuburl] = "http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom";
//throws: "unauthorized
parameters[dotcmis.sessionparameter.user] = "admin ";
parameters[dotcmis.sessionparameter.password] = "admin";
sessionfactory factory = sessionfactory.newinstance();
isession session = factory.getrepositories(parameters)[0].createsession();
before, encountered exception cmisruntimeexception - "sendfailure", changes "not found"/"unauthorized".
can explain me why encountering these errors? or wrong code?
thanks in advance!
best regards!
have nice day.
promoting comment answer
you need use correct cmis service url version of alfresco running. trying use 3.x url on 5.x server isn't work. can find cmis service url given version in version's documentation, or can overview of urls alfresco wiki
secondly, you'll need authenticating cmis server. don't have use admin, need use valid credentials
assuming have 4.2 server, administrator account called admin , password of admin, want like
parameters[dotcmis.sessionparameter.atompuburl] = "http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom"; parameters[dotcmis.sessionparameter.user] = "admin "; parameters[dotcmis.sessionparameter.password] = "admin"; sessionfactory factory = sessionfactory.newinstance(); isession session = factory.getrepositories(parameters)[0].createsession();
Comments
Post a Comment