AnsweredAssumed Answered

Python CMIS not connecting through SSH Tunnel

Question asked by tybion on Nov 9, 2015
I have created an SSH tunnel to an Alfresco 5.0.d server, and can connect fine via the tunnel with 1. my browser and 2. CMIS Workbench.

But this Python CMIS code ..
<python>
print "Connecting to Alfresco Server .."
client = CmisClient('http://localhost:8080/alfresco/cmisatom', 'admin', 'password')
repo = client.defaultRepository
</python>

.. produces this ..

Connecting to Alfresco Server ..
Traceback (most recent call last):
  File "C:\GI\Exif\alf_dwh_photos.py", line 42, in <module>
    repo = client.defaultRepository
  File "c:\Python2710\lib\site-packages\cmislib-0.5.1-py2.7.egg\cmislib\model.py
", line 179, in getDefaultRepository
  File "c:\Python2710\lib\site-packages\cmislib-0.5.1-py2.7.egg\cmislib\model.py
", line 208, in get
  File "c:\Python2710\lib\site-packages\cmislib-0.5.1-py2.7.egg\cmislib\model.py
", line 318, in _processCommonErrors
cmislib.exceptions.InvalidArgumentException: Error 400 at http://localhost:8080/
alfresco/api/-default-/public/cmis/versions/1.1/atom


CMIS Workbench connects through the SHH tunnel OK with these parameters ..

org.apache.chemistry.opencmis.binding.spi.type=atompub
org.apache.chemistry.opencmis.binding.atompub.url=http://localhost:8080/alfresco/cmisatom
org.apache.chemistry.opencmis.user=admin
org.apache.chemistry.opencmis.password=password
org.apache.chemistry.opencmis.binding.auth.soap.usernametoken=true
org.apache.chemistry.opencmis.binding.auth.http.basic=true
org.apache.chemistry.opencmis.binding.compression=true
org.apache.chemistry.opencmis.binding.clientcompression=false
org.apache.chemistry.opencmis.binding.cookies=true


Maybe I need to specify the authentication parameters above in Python? .. but I cannot find any Python examples using **kwargs.
<python>
class cmislib.model.CmisClient(repositoryUrl, username, password, **kwargs)
</python>

Can anyone help me, or have other ideas about how to make the Python CMIS work through an SSH tunnel?

Outcomes