I've downloaded the ejabberd xmlrpc module from http://www.ejabberd.im/ejabberd_xmlrpc. I've compiled it and added it to the ejabberd beams folder. I also added {4560, ejabberd_xmlrpc, [{maxsessions, 10}, {timeout, 5000}]}, to my config file. But after a restart of ejabberd, I get the following error in my ejabberd.log file.
=ERROR REPORT==== 2011-01-18 13:50:37 ===
E(<0.36.0>:ejabberd_listener:272) : Error starting the ejabberd listener: ejabberd_xmlrpc.
It could not be loaded or is not an ejabberd listener.
Error: {{'EXIT',{undef,[{xmlrpc,start_link,
[{0,0,0,0},
4560,10,5000,
{ejabberd_xmlrpc,handler},
{state,[],noauth,false}]},
{supervisor,do_start_child,2},
{supervisor,handle_start_child,2},
{supervisor,handle_call,3},
{gen_server,handle_msg,5},
{proc_lib,init_p,5}]}},
{child,undefined,
{4560,{0,0,0,0},tcp},
{ejabberd_listener,start,
[{4560,{0,0,0,0},tcp},
ejabberd_xmlrpc,
[{maxsessions,10},{timeout,5000}]]},
transient,brutal_kill,worker,
[ejabberd_listener]}}
=INFO REPORT==== 2011-01-18 13:50:37 ===
application: ejabberd
exited: {bad_return,{{ejabberd_app,start,[normal,[]]},
{module_not_available,xmlrpc}}}
type: temporary
The compiled file is in the beams folder, so why is the module not available? Does this have to do with the patch information listed on the module home page?
I found the compiled files
I found the compiled files for the xmerl patch and placed them in ejabberd-x.x.x\lib\kernel-x.x.x\ebin and ejabberd started up normally. Now to see if it works :)
Seems like now I've run up
Seems like now I've run up against another error:
PHP Warning: file_get_contents(http://127.0.0.1:4560/RPC2 ): failed to open stream: HTTP request failed!
I've checked to make sure that ejabberd is listening on that port. Is there something else I need to setup? Where does the /RPC2 come from?
Try this script
Where does the /RPC2 come from?
Maybe from the erlang xmlrpc library.
PHP Warning: file_get_contents(http://127.0.0.1:4560/RPC2 ): failed to open stream: HTTP request failed!
I've checked to make sure that ejabberd is listening on that port.
You should get something like this:
Is there something else I need to setup?
I found this PHP script file:
I have two account registered. When i run that script, I get this:
I've made sure that ejabberd
I've made sure that ejabberd is listening on port 4560, but I receive this error whenever I try to run a command.
PHP Warning: file_get_contents(http://127.0.0.1:4560/RPC2 ): failed to open stream: HTTP request
Code
protected /*string*/ function sendRequest(/*string*/$command,/*array*/$params){
//check that params is array if not create
if(!is_array($params)){
$params = array();
}
//$params["user"] = "admin";
//$params["host"] = "localhost";
$request = xmlrpc_encode_request($command, $params, (array('encoding' => 'utf-8')));
$context = stream_context_create(array('http' => array(
'method' => "POST",
'header' => "User-Agent: XMLRPC::Client mod_xmlrpc\r\n" .
"Content-Type: text/xml\r\n" .
"Content-Length: ".strlen($request),
'content' => $request
)));
$file = file_get_contents("http://127.0.0.1:4560/RPC2", false, $context);
$response = xmlrpc_decode($file);
if (xmlrpc_is_fault($response)) {
trigger_error("xmlrpc: $response[faultString] ($response[faultCode])");
} else {
return $response;
}
}