Connect using XML-RPC on Tryton 4.0

383 views
Skip to first unread message

PhiJ

unread,
May 18, 2016, 11:40:04 AM5/18/16
to tryton
Hi everybody,

I migrated to Tryton 4.0 and I am trying to use Proteus as I made before, connecting to my server with XML-RPC. However, I found that using the same config as I had for Tryton 3.8, my server doesn't allow the connection and throws: socket.error: [Errno 111] Connection refused

In my config file I have the following section:
[xmlrpc]
listen = *:8069
ssl_xmlrpc = True

And I use the method session = config.set_xmlrpc(url) to set the connection. 
Did something change about this topic? I couldn't find info about it, sorry if I missed it.

Thank you in advance. Best regards!

Cédric Krier

unread,
May 18, 2016, 2:00:05 PM5/18/16
to tryton
On 2016-05-18 08:23, PhiJ wrote:
> Hi everybody,
>
> I migrated to Tryton 4.0 and I am trying to use Proteus as I made before,
> connecting to my server with XML-RPC. However, I found that using the same
> config as I had for Tryton 3.8, my server doesn't allow the connection and
> throws: socket.error: [Errno 111] Connection refused
>
> In my config file I have the following section:
> [xmlrpc]
> listen = *:8069
> ssl_xmlrpc = True
>
> And I use the method *session = config.set_xmlrpc(url) *to set the
> connection.
> Did something change about this topic? I couldn't find info about it, sorry
> if I missed it.

In 4.0, both protocols json-rpc and XML-RPC are served from the same
interface. It is configured with
http://doc.tryton.org/4.0/trytond/doc/topics/configuration.html#web

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

PhiJ

unread,
May 20, 2016, 10:50:04 AM5/20/16
to tryton
Thank you Cedric.

I tried to connect using session = config.set_xmlrpc("http://admin:admin@localhost:8000/tryton_database") but it throws me the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/proteus/config.py", line 341, in set_xmlrpc
  File "build/bdist.linux-x86_64/egg/proteus/config.py", line 308, in __init__
  File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1587, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1306, in single_request
    return self.parse_response(response)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1482, in parse_response
    return u.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 794, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 255: '301: Moved Permanently'>


My cfg contains:
[web]
listen = *:8000
root = /home/frahergal/Semilimes/Tryton/sao

It works well for json-rpc and sao, but I cannot guess what happens with xml-rpc.

Best regards.

Cédric Krier

unread,
May 20, 2016, 11:25:04 AM5/20/16
to tryton
On 2016-05-20 07:44, PhiJ wrote:
> Thank you Cedric.
>
> I tried to connect using session =
> config.set_xmlrpc("http://admin:admin@localhost:8000/tryton_database") but
> it throws me the following error:

You must append a trailing '/' to the URL.


PS: Please don't top-post on this mailing list, see
http://groups.tryton.org/netiquette

PhiJ

unread,
May 20, 2016, 11:50:05 AM5/20/16
to tryton
Oh, I see. Thank you a lot again! Problem solved!

Best regards!
Reply all
Reply to author
Forward
0 new messages