← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #224126]: XML-RPC : Switch between client and server

 

Question #224126 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/224126

    Status: Answered => Open

testdrive is still having a problem:
Hi Raiman,
Hope that I have coded like what you said...The first request from MACHINE 1 gets served by MCAHINE 2 and gives output as  " Inside ServerWorkflowJust to say hello from Python ".
The next request from  MCAHINE 1(the presentclient) invokes SwitchServer function in MCAHINE 2(the present server) and prints "INside SwitchServer" but when it comes to the next statement: retval1 = hp_cli.clientWorkflow("Helloo from Python") it is returning "xmlrpclib.Fault: <Fault 1: "<class 'socket.error'>:(10061, 'Connection refused')">" in the eclipse console.
I tried with a different ip/port combination as well. Then also the same error.

Kindly take a look & verify my following code:


SCRIPT IN MACHINE 1: (having ip x.x.x.13:8000)



import SimpleXMLRPCServer

dell_cli = xmlrpclib.ServerProxy("http://192.168.173.12:8000";)
retval = dell_cli.ServerWorkflow("Just to say hello from Python")
switch = dell_cli.SwitchServer()

#TO SWITCH AS A SERVER

def clientWorkflow(param):
    popup("OK - from SimpleXMLRPClient ("+ str(param) + ")")
    return "OK"

dell_srv = SimpleXMLRPCServer.SimpleXMLRPCServer(("192.168.173.13",8000))
if not dell_srv : exit(1)
dell_srv.register_function(clientWorkflow)
dell_srv.serve_forever()




SCRIPT IN MACHINE 2: (having ip x.x.x.12:8000)


from sikuli.Sikuli import *
import xmlrpclib
import SimpleXMLRPCServer

def ServerWorkflow(parm):
    popup("Inside ServerWorkflow" + str(parm) + ")")
    return "OK"

def SwitchServer():
    #SWITCHING AS A CLIENT
    hp_cli = xmlrpclib.ServerProxy("http://192.168.173.13:8000";)
    popup("INside SwitchServer")
    retval1 = hp_cli.clientWorkflow("Helloo from Python")
    
hp_srv = SimpleXMLRPCServer.SimpleXMLRPCServer(("192.168.173.12", 8080)) 
if not hp_srv: exit(1)
hp_srv.register_function(ServerWorkflow)
hp_srv.register_function(SwitchServer)
hp_srv.serve_forever()

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.