Hi all,
I try to implement a python xml-rpc server and call it from a php
client. If the server and the client are on the same machine
(localhost) the communication between them is just fine. When I start
the server on a different host I don't get an answer.
What is missing there?? I tried also to set username and password,
cause I thought there is an authenticate issue but it didn't work
either.
Here is my code:
python server:
import SimpleXMLRPCServer
from re import *
import string
#The server object
class myFunctions:
def myTest(self, code):
mya = findall('#include.+',code)
stringo = string.join(mya,', ')
return stringo
calendar_object = myFunctions()
server = SimpleXMLRPCServer.SimpleXMLRPCServer(("xxx.xxx.xxx.xxx",
22999))
server.register_instance(calendar_object)
#Go into the main listener loop
print "Listening on port 22999"
server.serve_forever()
php client:
#include';
$function = "myTest";
$param = new XML_RPC_Value(htmlspecialchars($code), "string");
$params = array($param);
$message = new XML_RPC_Message($function, $params);
$client = new XML_RPC_Client("/new2.py","xxx.xxx.xxx.xxx",22999);
print_r($client);
$result = $client->send($message);
print_r($result);
$value = $result->value();
$number = $value->scalarval();
echo "Return Value: $number ";
echo "Headers are: $number ";
?>
Thanx in advance :)
--
http://mail.python.org/mailman/listinfo/python-list