Commit 684265ca authored by Vincent Pelletier's avatar Vincent Pelletier

Add an optional "transport_kw" parameter to WebServiceTool.connect(), allowing...

Add an optional "transport_kw" parameter to WebServiceTool.connect(), allowing to pass extra keyword parameters to a specific transport class constructor.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27122 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 47b7d1e1
...@@ -78,15 +78,18 @@ class WebServiceTool(BaseTool): ...@@ -78,15 +78,18 @@ class WebServiceTool(BaseTool):
security.declareProtected(Permissions.ManagePortal, 'manage_overview') security.declareProtected(Permissions.ManagePortal, 'manage_overview')
manage_overview = DTMLFile('explainWebServiceTool', _dtmldir ) manage_overview = DTMLFile('explainWebServiceTool', _dtmldir )
def connect(self, url, user_name=None, password=None, transport=None): def connect(self, url, user_name=None, password=None, transport=None, transport_kw=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
different kinds of transport like 'xml-rpc' or 'soap' different kinds of transport like 'xml-rpc' or 'soap'
""" """
# XXX: implement connection caching per zope thread # XXX: implement connection caching per zope thread
if transport_kw is None:
transport_kw = {}
connection_handler_klass = connection_plugin_registry[transport] connection_handler_klass = connection_plugin_registry[transport]
connection_handler = connection_handler_klass(url, user_name, password) connection_handler = connection_handler_klass(url, user_name, password,
**transport_kw)
return connection_handler.connect() return connection_handler.connect()
InitializeClass(WebServiceTool) InitializeClass(WebServiceTool)
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