Commit 97b921b8 authored by Ivan Tyagov's avatar Ivan Tyagov

Fix wrong API.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25674 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2c789709
...@@ -39,7 +39,7 @@ class WebServiceMixIn: ...@@ -39,7 +39,7 @@ class WebServiceMixIn:
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareProtected('connect', Permissions.ManagePortal) security.declareProtected('connect', Permissions.ManagePortal)
def connect(self, url, user_name=None, password=None, authentication_method=None): def connect(self, url, user_name=None, password=None, transport=None):
""" """
Connect to remote instances Connect to remote instances
of any kind of web service (not only ERP5) with many of any kind of web service (not only ERP5) with many
...@@ -47,9 +47,9 @@ class WebServiceMixIn: ...@@ -47,9 +47,9 @@ class WebServiceMixIn:
authentication_method: 'xml-rpc' or 'soap' authentication_method: 'xml-rpc' or 'soap'
""" """
# XXX: implement connection caching per zope thread # XXX: implement connection caching per zope thread
if authentication_method == 'xml-rpc': if transport == 'xml-rpc':
connection_handler = XMLRPCConnection(url, user_name, password) connection_handler = XMLRPCConnection(url, user_name, password)
elif authentication_method == 'soap': elif transport == 'soap':
connection_handler = SOAPConnection(url, user_name, password) connection_handler = SOAPConnection(url, user_name, password)
connection_handler = connection_handler.connect() connection_handler = connection_handler.connect()
......
...@@ -48,5 +48,3 @@ class XMLRPCConnection: ...@@ -48,5 +48,3 @@ class XMLRPCConnection:
url = '%s://%s:%s@%s%s' %(schema[0], self._user_name, self._password, url = '%s://%s:%s@%s%s' %(schema[0], self._user_name, self._password,
schema[1], schema[2]) schema[1], schema[2])
return xmlrpclib.ServerProxy(url, allow_none=1) return xmlrpclib.ServerProxy(url, allow_none=1)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment