xmlrpclib question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • writeson

    #1

    xmlrpclib question

    Hi,
    I tried the xmlrpclib examples from the Python Cookbook and had a
    problem. The example works fine so long as the server and client are on
    the same machine. But as soon as I try to run the client from another
    machine (all linux machines on the same network) I get a socket.error
    111, connection refused. I've tried some different things to get past
    this, different ports, put machines in /etc/hosts, but to no avail.
    Does anyone have any suggestions about what I'm doing wrong? Is there
    something I have to enable external access to the server?
    Thanks in advance,
    Doug Farrell

  • Fredrik Lundh

    #2
    Re: xmlrpclib question

    "writeson" <writeson@chart er.net> wrote:
    [color=blue]
    > I tried the xmlrpclib examples from the Python Cookbook and had a
    > problem. The example works fine so long as the server and client are on
    > the same machine. But as soon as I try to run the client from another
    > machine (all linux machines on the same network) I get a socket.error
    > 111, connection refused. I've tried some different things to get past
    > this, different ports, put machines in /etc/hosts, but to no avail.[/color]

    the xmlrpclib client library doesn't need any special configuration to access a
    remote host -- all you need is being able to connect to the host via a TCP/IP
    socket, and having someone at the other end that accepts the connection.

    if you're 100% sure that there's a HTTP server running at the remote end, it
    looks like the server (or firewalls/routers in your network) doesn't accept TCP/IP
    connections from the machine you're running the client on.

    what happens if you point an unproxied web browser to the same address?

    what happens if you telnet to the machine? (make sure you telnet to the right port)

    $ telnet somemachine someport
    Trying 123.456.789...
    Connected to somemachine.
    Escape character is '^]'.
    HELP
    <html><head>
    <title>501 Method Not Implemented</title>
    </head><body>
    <h1>Method Not Implemented</h1>
    <p>HELP to / not supported.<br />
    </p>
    ...

    </F>



    Comment

    • chris.lyon@spritenote.co.uk

      #3
      Re: xmlrpclib question

      Have you left localhost/127.0.0.1 in the server command?
      try replacing it with an empty string.

      Comment

      • writeson

        #4
        Re: xmlrpclib question

        Thanks for the responses, you were both on the right track, I just
        didn't provide enough of the right information. I solved the problem by
        changing "localhost" in the server code to actually contain the name of
        the machine, the same as it appears in our DNS. This enabled the client
        to connect to the server immediately. It's not clear in the example
        code that this is necessary, but it makes sense that the server
        wouldn't be able to 'listen' to anything on "localhost" other than same
        machine applications because they would all use the lo interface.
        Thanks!
        Doug

        Comment

        Working...