在我的项目中,我们正试图使用CMIS获得文件夹存储库,我使用python脚本来测试它;下面是我使用的
代码from cmislib.model import CmisClient
client = CmisClient('http://localhost/CMIS/Service/servicedoc', 's', 's')
repo = client.defaultRepository
info = repo.info
for k,v in info.items():
print "%s:%s" % (k,v)
somefld = repo.getObject('idf_96_Z2CMIS')
props = somefld.properties
for k,v in props.items():
print "%s:%s" % (k,v)
这段代码工作得很好。然而,现在的服务是SSL启用所以(https//localhost/CMIS/service/servicedoc),当我改变在CmisClient的URL它抛出以下错误
c:Python27>python.exe cmis.py
CMIS client connection to https://localhost/Cmis/Service/servicedoc
Traceback (most recent call last):
File "cmis.py", line 4, in <module>
repo = client.defaultRepository
File "c:Python27libsite-packagescmislib-0.5.1-py2.7.eggcmislibmodel.py",
line 179, in getDefaultRepository
File "c:Python27libsite-packagescmislib-0.5.1-py2.7.eggcmislibmodel.py",
line 206, in get
File "c:Python27libsite-packagescmislib-0.5.1-py2.7.eggcmislibnet.py", l
ine 145, in get
File "c:Python27liburllib2.py", line 404, in open
response = self._open(req, data)
File "c:Python27liburllib2.py", line 422, in _open
'_open', req)
File "c:Python27liburllib2.py", line 382, in _call_chain
result = func(*args)
File "c:Python27liburllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "c:Python27liburllib2.py", line 1184, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 10054] An existing connection was forcibly closed by the remote host>
如何使用CMISClient库连接到启用SSL的网站。
我把URL改为<>而不是localhost https://<>/Cmis/Service/servicedoc,它工作了。