mod_xmlrpc - XML-RPC Server

Name: mod_xmlrpc
Purpose: XML-RPC server to communicate directly with ejabberd
Author: Badlop
Type: Module
Requirements: ejabberd 1.1.2 or newer, and XML-RPC-Erlang 1.13 with IP, Ruby and Xmerl 1.x patches (you can get it compiled for Erlang R12 or R13)
Download: ejabberd-modules
Note: this module will only receive bugfixes. If you are using ejabberd trunk SVN 1635 or newer, you will probably prefer to install ejabberd_xmlrpc.

mod_xmlrpc is a module for ejabberd, a XMPP/Jabber server written in Erlang. It starts a XML-RPC server and waits for external requests. Implemented calls include statistics and user administration. This allows external programs written in any language like websites or administrative tools to communicate with ejabberd to get information or to make changes without the need to know ejabberd internals.

One example usage is a corporate site in PHP that creates a Jabber user every time a new user is created on the website.

Some benefits of interfacing with the Jabber server by XML-RPC instead of modifying directly the database are:

  • external programs are more simple and easy to develop and debug
  • can communicate with a server in a different machine, and even on Internet

Related Links

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

send message to user

I am having issue while sending message to user through RPC2. if any one have suggestion please let me know.

How to compile xmlrpc-1.13-ipr2 for windows?

I am trying to compile it for windows, but this tutorial below don't work:

1. You need to get and install XMLRPC-Erlang.
You can download XMLRPC-Erlang binary files from
http://www.ejabberd.im/ejabberd_xmlrpc
or compile it yourself:
wget http://www.ejabberd.im/files/contributions/xmlrpc-1.13-ipr2.tgz
tar -xzvf xmlrpc-1.13-ipr2.tgz
cd xmlrpc-1.13/src
make
cd ../../
Then you can copy the *.beam files to ejabberd ebin directory,
or add an option like this to the ejabberd start script:
$ erl -pa '/home/jabber/xmlrpc-1.13/ebin' ...

Make command don't work. Is There a way to compile this module in Windows?

ProtocolError in python

import xmlrpclib

print "hello"

# Create an object to represent our server.
server_url = 'http://127.0.0.1:4560';
server = xmlrpclib.Server(server_url);

# Call the server and get our result.
try:
    result = server.echothis("800")
    print result
except xmlrpclib.ProtocolError, err:
    print "A protocol error occurred"
    print "URL: %s" % err.url
    print "HTTP/HTTPS headers: %s" % err.headers
    print "Error code: %d" % err.errcode
    print "Error message: %s" % err.errmsg

I obtain:

hello
A protocol error occurred
URL: 127.0.0.1:4560/RPC2
HTTP/HTTPS headers: None
Error code: -1
Error message:

I have the version 2.0.5, compiled myself the mod_xmlrpc (thus with erlang version 5.6.5) and got compiled .beams from the upload in this page for erlang-xmlrpc (thank you badlop) thus with erlang version r12b5-5.6.5 too.
I'm on windows.
Does anyone have an idea for the reason of that or how can I debug this?

Java example

Here's Java example client for mod_xmlrpc:

import java.net.URL;
import java.util.HashMap;
import java.util.Map;

import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

public class Test {

	public static void main(String[] args) {
		try {
		    XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
		    config.setServerURL(new URL("http://127.0.0.1:4560/RPC2"));
		    XmlRpcClient client = new XmlRpcClient();
		    client.setConfig(config);

		    /* Command string */
		    String command = "check_password";

		    /* Parameters as struct */
		    Map struct = new HashMap();
		    struct.put("user", "test1");
		    struct.put("host", "localhost");
		    struct.put("password", "test");

		    Object[] params = new Object[]{struct};
		    Integer result = (Integer) client.execute(command, params);
		    System.out.println(result);
		} catch (Exception e) {
			System.out.println(e);
		}
	}

}

Requires Apache XML-RPC available at http://ws.apache.org/xmlrpc/

Java example and PHP committed

Thanks, I've added your Java example, and fixed the PHP example.

Wrong PHP example

README.txt for mod_xmlrpc contains not working PHP example, due to improper request headers. Here is the code that works:

$param = array("user"=>"test_user","host"=>"example.com","password"=>"some_password");
$request = xmlrpc_encode_request('check_password', $param, (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 {
	print_r($response);
}

You must also remember to set "allow_url_fopen = On" in the php.ini.

Have you solved it yet?

edit: Apologies, this was meant to be in reply to wina's post "couldn't run mod_xmlrpc on my localhost"

I am running into the same problem were you able to find a solution? Thank you

couldn't run mod_xmlrpc on my localhost

hi,

I still couldnt install this module on my localhost(Window)
anybody could help? thanks in advance.

=ERROR REPORT==== 2008-04-24 14:16:15 ===
E(<0.36.0>:gen_mod:66) : {undef,[{mod_xmlrpc,start,["localhost",[]]},
{gen_mod,start_module,3},
{lists,foreach,2},
{ejabberd_app,start,2},
{application_master,start_it_old,4}]}

Installed XMLERL-1.3

Have you installed xmlerl-1.3?

Do you in your start up script for ejabberd pass the -pa '/path/to/xmlerl/ebin' parameter to it??

This was what caused me not to be able to run it, i did not have in the startup the -pa and i modified the ejabberdctl file to add it as a configuration parameter for startup.

had xmerl installed

i have xmerl-1.1.4\ebin\*.beam files and xmlrpc-1.13\ebin\xmlrpc.beam file inside my lib directory.
i didnt pass the parameter, with your information i tried to add it but still doesn't work.

my bin\ejabberdctl configuration looks like below.

EJABBERD_XMERL="$ROOTDIR/lib/xmerl-1.1.4/ebin"

# start server
start()
{
exec $ERL $NAME $ERLANG_NODE $ERLANG_OPTS \
-pa $EJABBERD_XMERL \
-noinput -detached \
-mnesia dir "\"$EJABBERD_DB\"" \
-s ejabberd \
-ejabberd config \"$EJABBERD_CONFIG_PATH\" \
log_path \"$EJABBERD_LOG_PATH\" \
-sasl sasl_error_logger \{file,\"$SASL_LOG_PATH\"\}
}

did i set it wrong?

Receiving {error, closed} when I test xmlrpc

my config:
fedora Core 6
erlang-R11B-2.3.fc6
ejabberd 1.1.4
xmerl-0.20
xmlrpc-1.13-ipr2

/conf/ejabberd.cfg contains the following line:
{mod_xmlrpc,[{port, 4560},{timeout, 60000}]}

contents of directory /ejabberd-1.1.4/lib/ejabberd-1.1.4/ebin:

acl.beam ejabberd_auth_odbc.beam ejabberd_s2s.beam extauth.beam mod_last.beam mod_sms.beam tcp_serv.beam xmerl_xlate.beam
adhoc.beam ejabberd.beam ejabberd_s2s_in.beam gen_iq_handler.beam mod_last_odbc.beam mod_stats.beam tls.beam xmerl_xml.beam
configure.beam ejabberd_c2s.beam ejabberd_s2s_out.beam gen_mod.beam mod_muc.beam mod_time.beam translate.beam xmerl_xpath.beam
cyrsasl_anonymous.beam ejabberd_config.beam ejabberd_service.beam iconv.beam mod_muc_log.beam mod_vcard.beam transliteration.beam xmerl_xpath_parse.beam
cyrsasl.beam ejabberd_ctl.beam ejabberd_sm.beam idna.beam mod_muc_room.beam mod_vcard_ldap.beam xmerl.app xmerl_xpath_pred.beam
cyrsasl_digest.beam ejabberd_hooks.beam ejabberd_sup.beam jd2ejd.beam mod_offline.beam mod_vcard_odbc.beam xmerl.beam xmerl_xpath_scan.beam
cyrsasl_plain.beam ejabberd_http.beam ejabberd_tmp_sup.beam jlib.beam mod_offline_odbc.beam mod_version.beam xmerl_eventp.beam xmerl_xs.beam
ejabberd_admin.beam ejabberd_http_poll.beam ejabberd_update.beam mod_adhoc.beam mod_privacy.beam mod_xmlrpc.beam xmerl_html.beam xml.beam
ejabberd.app ejabberd_listener.beam ejabberd_web_admin.beam mod_announce.beam mod_private.beam odbc_queries.beam xmerl_lib.beam xmlrpc.beam
ejabberd_app.beam ejabberd_local.beam ejabberd_web.beam mod_configure2.beam mod_pubsub.beam randoms.beam xmerl_otpsgml.beam xmlrpc_decode.beam
ejabberd_auth_anonymous.beam ejabberd_logger_h.beam ejabberd_zlib.beam mod_configure.beam mod_register.beam sha.beam xmerl_scan.beam xmlrpc_encode.beam
ejabberd_auth.beam ejabberd_odbc.beam ejd2odbc.beam mod_disco.beam mod_roster.beam shaper.beam xmerl_sgml.beam xmlrpc_http.beam
ejabberd_auth_external.beam ejabberd_odbc_sup.beam eldap.beam mod_echo.beam mod_roster_odbc.beam ssmtp.beam xmerl_simple.beam xmlrpc_util.beam
ejabberd_auth_internal.beam ejabberd_receiver.beam eldap_filter.beam mod_irc.beam mod_service_log.beam stringprep.beam xmerl_text.beam xml_stream.beam
ejabberd_auth_ldap.beam ejabberd_router.beam ELDAPv3.beam mod_irc_connection.beam mod_shared_roster.beam stringprep_sup.beam xmerl_validate.beam XmppAddr.beam

When I start ejabberd: no errors with mod_xmlrpc

Listener started on port 4560

But when I try to execute xmlrpc:call({127, 0, 0, 1}, 4560, "/", {call, echothis, [800]}). I get {error, closed}

Any help will be greatly appreciated.

Thanks/Prasad

It works now...

The problem was that the /lib/ejabberd-1.1.4/ebin directory was missing the UCS app and beam files.
Once I dropped those in, things started to work fine.

Thanks/Prasad

xmlrpc:call fails with Bad Request?

I am trying to use xmlrpc and want to rpc to dot net. I've formulated the call below, which is an online xmlrpc service to return the current time. This call keeps failing with a bad request error response (pasted below). Can't figure out why.

xmlrpc:call("time.xmlrpc.com", 80, "/", {call, currentTime.getCurrentTime, []}).
{error,"HTTP/1.1 400 Bad Request\r\n"}

Any pointers as to what I’m doing wrong would be really appreciated.

How to bind

How do i bind xml_rpc to a specific IP address?

XMP_RPC: Ok, Now I'm confused

Hi,

According to this page (https://support.process-one.net/doc/display/MESSENGER/ejabberd+integrati...), mod_xmlrpc has been integrated with ejabberd in the latest installer version. This means that the XMLRPC server is already installed and preconfigured. But when I edit the config file and uncomment the line that contains mod_xmlrpc I get :

Quote:

=ERROR REPORT==== 2007-02-13 13:14:11 ===
E(<0.35.0>:gen_mod:47): {undef,[{mod_xmlrpc,
start,
["typhon.svo.co.za",
[{port,4560},{timeout,5000}]]},
{gen_mod,start_module,3},
{lists,foreach,2},
{ejabberd_app,start,2},
{application_master,start_it_old,4}]}

Any help would be appreciated.

Is this module could help to

Is this module could help to ask ejabberd about active chatrooms and chatrooms confs ?
I think not but I'm not sur to understand usage of tellme, tellme_title and tellme_value.

Thanks for answers.

Maybe

Brunus wrote:

Is this module could help to ask ejabberd about active chatrooms and chatrooms confs ?
I think not but I'm not sur to understand usage of tellme, tellme_title and tellme_value.

Maybe tellme_value with mod_statsdx installed allows to know registered chatrooms. Chatrooms config is not possible.

security issue

Hello.

Is there any type of authentication with rpc module ?

I think it must be at least two passwords: for readonly commands and for readwrite commands.

( And module starting can look like {mod_xmlrpc, [{rpcreadpass,"12345"},{rpcwritepass,'54321'}]} )

Also It can be several access levels, like:

level 1 - readonly
level 2 - can add info (or accounts)
level 3 - can change info
level 4 - can delete info

etc, with different passwords.

none right now

MMM wrote:

Is there any type of authentication with rpc module ?

It would be nice, but no authentication method is currently implemented, and I don't have it on my to-do list. So if you have interest in implementing it... :)

mod_xmlrpc - something more than echothis ... but how?

Hi,

From erlang I can create an account (or modify it)

Eshell V5.5.1  (abort with ^G)
1> xmlrpc:call({127, 0, 0, 1}, 4560, "/", {call, create_account,
1> [{struct, [{user, "ggeo"}, {host, "example.com"}, {password, "gogo11"}]}]}).
{ok,{response,[1]}}

But how does this translate to say python? According to the python docs (http://docs.python.org/lib/module-xmlrpclib.html), a structure maps to a dictionary, so, and this might be naive, this is my python code:

server_url = 'http://localhost:4560';
server = xmlrpclib.Server(server_url);

params = {}
params["user"] = "ggeo"
params["host"] = "example.com"
params["password"] = "gogo11"

result = server.create_account(params)
print result

But all I get is:

xmlrpclib.Fault: "Fault -1: 'Unknown call: {call,create_account,\n 
 [{struct,[{host,"example.com"},\n {password,"gogo11"},\n {user,"ggeo"}]}]}'"

What happens here? And I still cant get any logging into the ejabberd.log, even with the piece of code mentioned below.

Please, can you help me again?

Regards, Dirk

Fixed on mod_xmlrpc 0.2.4

diddek wrote:

What happens here?

It was a bug on mod_xmlrpc: it only allowed attributes to be on exactly the same order as expected (user, host, password). Python for some reason changes the order (host, password, user).

Try the new mod_xmlrpc 0.2.4, it allows attributes in any order. If a required attribute is not provided (try putting 'pasword' instead of 'password' on your python client), ejabberd should report an error on the log file.

diddek wrote:

And I still cant get any logging into the ejabberd.log, even with the piece of code mentioned below.

Try to induce an error (the pasword example).

BTW, I added your example Python client to the readme.

mod_xmlrpc only works in erlang?

Hi,

After I rebuild everyting with otp_src_R11B-1 mod_xmlrpc works in erlang:

Eshell V5.5.1  (abort with ^G)
1> xmlrpc:call({172,16,29,6}, 4560, "/", {call, echothis, [800]}).
{ok,{response,[800]}}

But when I try call ejabberd/mod_xmlrpc from another language (I tried Ruby, Python and C++) I cannot get good results. Ruby and Python fail always, C++ has one in ten times the 'echothis' call succeeds (The other calls dont work).

Ruby:

  require 'xmlrpc/client'

  host = "172.16.29.6:4560"
  timeout = 3000000
  client = XMLRPC::Client.new2("http://#{host}", "#{host}", timeout)
  result = client.call("echothis", "800")
  puts result 
result =
C:/ruby/lib/ruby/1.8/net/protocol.rb:133:in `sysread': end of file reached (EOFError)
        from C:/ruby/lib/ruby/1.8/net/protocol.rb:133:in `rbuf_fill'
        from C:/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout'

Python:

  import xmlrpclib

  # Create an object to represent our server.
  server_url = 'http://172.16.29.6:4560';
  server = xmlrpclib.Server(server_url);

  # Call the server and get our result.
  result = server.echothis("800")
  print result
result =
xmlrpclib.ProtocolError: <ProtocolError for 172.16.29.6:4560/RPC2: -1 >

C++:

  XmlRpc::XmlRpcClient xmlrpc_client("172.16.29.6", 4560);
  
  {
    XmlRpc::XmlRpcValue buf, result;
    buf[0] = "800";

    if (xmlrpc_client.execute("echothis", buf, result))
      std::cout << result << std::endl;
    else
      std::cout << "Error calling 'echothis'" << std::endl;
  }
result =
XmlRpcSocket::nbWrite: send/write returned 258.
XmlRpcClient::writeRequest: wrote 258 of 258 bytes.
XmlRpcSocket::nbRead: read/recv returned -1.
XmlRpcClient::readHeader: client has read 0 bytes

So what a I doing wrong here? And how can I see what's going on inside ejabberd/erlang?

To me it looks like mod_xmlrpc is not responsive all the time.

Can you help me?

Regards, Dirk

I found the problem with the

I found the problem with the ruby code.
the ruby XMLRPC library sends the following header :
Content-Type: text/xml; charset=utf-8
And the parse header function in xmlrpc_http.erl (line 96) will not accept a Content-Type different from
Content-Type: text/xml

So to make it compatible with the ruby library I added the following in xmlrpc_http.erl after line 98 :

{"Content-Type:", "text/xml; charset=utf-8"} ->
    parse_header(Socket, Timeout,
Header#header{content_type = "text/xml; charset=utf-8"});

That's the first problem.

The next problem is that the ruby library require Content-type to be set in the response header. Which is not the case.
This one is easily corrected :
Just add after line 198 :

"Content-Type: text/xml\r\n",

It works now. BTW I decided to patch xmlrpc erlang lib and not the ruby lib, as the ruby lib belong to the core ruby libs.

Accented characters can't be sent around -- makes the ruby lib to fail while parsing the answer. Any pointers welcome though :)

Eric
http://www.cestari.info

Updated library with your patches.

Thanks for your reports. I've updated the copy of Erlang xmlrpc library that is hosted here, with your two small patches, and I call it xmlrpc-1.13-ipr.tgz. The added r is for Ruby :)

BTW, I added mod_xmlrpc to ejabberd-modules SVN repository. Updated versions will be published there.

cstar wrote:

Accented characters can't be sent around -- makes the ruby lib to fail while parsing the answer. Any pointers welcome though :)

Well, maybe the Erlang library does not send UTF-8 characters, as Ruby expects. If that's the problem, maybe you find some useful hints somewhere in ejabberd or Yaws source code.

Followup

badlop wrote:

Thanks for your reports. I've updated the copy of Erlang xmlrpc library that is hosted here, with your two small patches, and I call it xmlrpc-1.13-ipr.tgz. The added r is for Ruby :)

great ! BTW the ruby client behavior has apparently changed from Ruby 1.8.2 and Ruby 1.8.4 (which added the charset=utf-8 thingy in the header)

badlop wrote:

Well, maybe the Erlang library does not send UTF-8 characters, as Ruby expects. If that's the problem, maybe you find some useful hints somewhere in ejabberd or Yaws source code.

I figured so. I had xmlrpc working with xmerl 1.1.4 without issues, and this version contains a very interesting xmerl_ucs module which should help.

Is Xmerl 0.20 still required nowadays?

cstar wrote:

I figured so. I had xmlrpc working with xmerl 1.1.4 without issues

Is Xmerl 1.1.4 the version included in recent Erlang/OTP releases? If so, do you mean that it's not required to install this Xmerl 0.20 library for mod_xmlrpc to work correctly?

I don't think so !

From my limited tests (getting multhis and echothis to work correctly with a Ruby client) Xmerl 0.20 is not required anymore with Erlang 5.5/OTP R11B (I have ejabberd built from source so one may have to check for the binary installer).

I guess you can safely remove the Xmerl 0.20 dependency from the documentation.

http://www.cestari.info

Python example works for me

diddek wrote:

So what a I doing wrong here? And how can I see what's going on inside ejabberd/erlang?

I modified the source code of the echothis call like this:

handler(_State, {call, echothis, [A]}) ->
    io:format(" --- mod_xmlrpc received a call echothis: ~p~n", [A]),
    {false, {response, [A]}};
diddek wrote:

To me it looks like mod_xmlrpc is not responsive all the time.

Then I made some experiments. The Python example worked 100% times, the Ruby did not, it seems I miss a library.

Experiment 1:

$ python -V
Python 2.4.4c0

$ cat client.py
import xmlrpclib

# Create an object to represent our server.
server_url = 'http://127.0.0.1:4560';
server = xmlrpclib.Server(server_url);

# Call the server and get our result.
result = server.echothis("880")
print result

$ python client.py
880

On the ejabberd logs:

 --- mod_xmlrpc received a call echothis: "880"

I tried the python client several times, and always worked.

Experiment 2:

$ ruby --version
ruby 1.8.5 (2006-08-25) [i486-linux]

$ cat client.rb
require 'xmlrpc/client'

#host = "172.16.29.6:4560"
host = "127.0.0.1:4560"
timeout = 3000000
client = XMLRPC::Client.new2("http://#{host}", "#{host}", timeout)
result = client.call("echothis", "800")
puts result

$ ruby client.rb
/usr/lib/ruby/1.8/xmlrpc/client.rb:546:in `do_rpc': HTTP-Error: 415 Unsupported Media Type (RuntimeError)
        from /usr/lib/ruby/1.8/xmlrpc/client.rb:420:in `call2'
        from /usr/lib/ruby/1.8/xmlrpc/client.rb:410:in `call'
        from client.rb:7

On the ejabberd logs:

=ERROR REPORT==== 6-Nov-2006::18:07:11 ===
{tcp_serv,139,{xmlrpc_http,handler,enotconn}}

I coundn't try the C++ example since I don't know how to compile it successfully.

I use Erlang R11B-1 too, and the versions of erlang-xmlrpc and xmerl are the ones indicated on my readme.

Since the only noticeable change is the IP address and obviously software versions, you could try to upload the clients to the same machine, and put 127.0.0.1.

Make sure to use the xmerl version indicated on the readme.

mod_xmlrpc works, but you need a proper hostname

Hi,

The python example works on the server, either on '127.0.0.1' or '172.16.29.6' - even with a different python version (I used 2.4.3); on my pc, somewhere else in the network, it does not work: I get the same python protocoll error (there is no firewall).

Interestingly, the c++ client works allways if I set mod_xmlprc to {ip,all} and connect on a hostname, not an ip address - but if I change to 172.16.29.6 for the c++ client it almost allways fails. Anyway, setting 'all' I do not want, I want xmlrpc on a specific interface, without having to setup specific firewall rules.

In the ruby client the following happens, it sends:

/RPC2
User-AgentXMLRPC::Client (Ruby 1.8.4)Content-Typetext/xml; charset=utf-8Connectionkeep-aliveContent-Length153
<?xml version="1.0" ?>echothissomeuser

(note: this forum eats the xml tags)

But then a # happens, dont know why: the xml looks fine.

Towards a solution: to me, all this seems like ejabberd has it's own ideas on ip/hostname;

- adding '172.16.29.6' to {hosts in ejabberd.cfg does not help.

- setting an alias in /etc/hosts on both server and client and adding it to ejabberd.cfg works for the c++ client - and sometimes I get a good result with python, but mostly it's a 'protocol error'. Very strange.

Did you try it with another language from another machine?

Regards, Dirk

BTW I added the logging line to mod_xmlrpc, but nothing shows up in the log. Do I need some additional libraries, a path, a ...?

mod_xmlprc rebuild with v0.2.3 still broken?

Hi,

I recompiled ejabberd with v0.2.3 (and all depencies mentioned in the xml_rpc docs), but I still get a

{error,closed}

Without any further info. So I tried to raise the log level by setting debug flags (there is a howto somewhere on this forum), but I could not see any change in output ...

Well, erlang is new to me :)

If I play around with the function call:

xmlrpc:call({172, 16, 29, 6}, 4560, "/", {call, echothis, [800]}).

I can get this:

** exited: {function_clause,[{gen_tcp,send,
                                      [{172,16,29,6},
                                       ["POST ",
                                        4560,
                                        " HTTP/1.1\r\n",
                                        "Content-Length: ",
                                        "140",
                                        "\r\n",
                                        "User-Agent: Erlang XML-RPC Client 1.13\r\n",
                                        "Content-Type: text/xml\r\n",
                                        "Connection: close\r\n",
                                        "\r\n",
                                        ["<?xml version=\"1.0\"?><methodCall><methodName>",
                                         "echothis",
                                         "</methodName>",
                                         ["<params>",
                                          ["<param><value>",
                                           ["<int>"|...],
                                           "</value></param>"],
                                          "</params>"],
                                         "</methodCall>"]]]},
                             {xmlrpc,call,5},
                             {erl_eval,do_apply,5},
                             {shell,exprs,6},
                             {shell,eval_loop,3}]} **

this sort of looks like valid xmlrpc to me.

So why do I get this {error,closed}?

Interestingly enough, tcpdump dos not see any activity on 172.16.29.6, but netstat says the port is open.

Can you help me?

Regards, Dirk

It works for me; make sure to follow the txt

I've downloaded, compiled and installed mod_xmlrpc and requirements as described on the txt, and the example works as expected.

I tried also with Erlang R11B-1 and ejabberd 1.1.2.

Make sure you use XMERL 0.20 downloaded from the SOWAP website, and follow all the steps.

mod_xmlrpc error

Hi,

I was wondering how t get rid of the error message:

=ERROR REPORT==== 26-Oct-2006::10:43:52 ===
E(<0.37.0>:gen_mod:47): {undef,[{mod_xmlrpc,start,["localhost",[]]},
{gen_mod,start_module,3},
{lists,foreach,2},
{ejabberd_app,start,2},
{application_master,start_it_old,4}]}

I recompiled ejabberd, so there is a mod_xmlrpc.beam in my ejabberd/ebin dir and I added this line to my ejabberd.cfg:

{mod_xmlrpc, []}

Note, if I change it to:

{mod_xmlrpc, [{port, 4560}, {ip, {172,16,29,6}}]}

I get the same error. I also tried to increase ejabberd's loglevel, but nothing happens so I dont have more info. I use ejabberd-1.1.2, xmlrpc-1.13 with the ip patch and xmerl-1.0.3 and erlang otp_src_R10B-10 with the epoll patch.

So what should I do? I sort of really need this functionality.

Regards, Dirk

Uploaded mod_xmlrpc 0.2.3 again

diddek wrote:

I was wondering how t get rid of the error message:

=ERROR REPORT==== 26-Oct-2006::10:43:52 ===
E(<0.37.0>:gen_mod:47): {undef,[{mod_xmlrpc,start,["localhost",[]]},
{gen_mod,start_module,3},
{lists,foreach,2},
{ejabberd_app,start,2},
{application_master,start_it_old,4}]}

Because the version you try to use is too old.

For some unknown reason the download links on this page were completely wrong. They are fixed now, and link to mod_xmlrpc 0.2.3. Try again.

mod_xmlrpc error again / how can i make it work?

Hi,

It seems, if I remove xmerl-1.0.3 to xmerl-0.20 and my ejabberd.cfg is:

{mod_xmlrpc, [{port, 4560}, {ip, {172,16,29,6}}]}

then erjabberd starts. But, when I try a test call

2> xmlrpc:call({172,16,29,6}, 4560, "/", {call, echothis, [800]}).

then the reply is:

{error,closed}

This is not very much info :)

Loaded modules are:
xmlrpc 6736
xmlrpc_encode 5471

So there is something there, but how do I make it run correctly?

Rgeards, Dirk

mod_xmlrpc 0.2.3 cannot be found

Hi,

I was wondering where to get the 0.2.3 version, the 'source link' gives 'v0.1 - 4 April 2005' and 'http://www.ejabberd.im/files/efiles/mod_xmlrpc' gives 0.2.2.

I would like to get the latest version, if possible.

Dirk

mod_xmlrpc v0.2.4

Hello.

I don't understand what is wrong?...

I downloaded module by link
http://www.ejabberd.im/files/contributions/mod_xmlrpc.erl
it is version 0.2.4 at this moment.

I have compiled module by

erlc mod_xmlrpc.erl

after that I moved mod_xmlrpc.beam in ebin folder

and modified ejabberd.cfg

...
% Used modules:
{modules,
[
...
{mod_xmlrpc, []},
...

but I cannot run this module :-(

In ejabberd.log i see

=ERROR REPORT==== 2007-04-26 18:06:53 ===
E(<0.35.0>:gen_mod:47): {undef,[{xmlrpc,
start_link,
[all,
4560,
10,
50,
{mod_xmlrpc,handler},
started]},
{mod_xmlrpc,start,2},
{gen_mod,start_module,3},
{lists,foreach,2},
{ejabberd_app,start,2},
{application_master,start_it_old,4}]}

what does mean?

As I understand I have old version of mod?...

help me please

PS: Tell me am I really need "Xmerl 0.20" and "XML-RPC-Erlang 1.13 with IP patch"? For what?

Today I have read more

Today I have read more carefully documentation and discover than ejabberd have builin xmlrpc mod.
But if I uncomment lines in config

{mod_xmlrpc,[{port, 4560},{timeout, 5000}]}

after startup I receiced next message in ejabberd.log

=ERROR REPORT==== 2007-04-27 14:53:30 ===
E(<0.35.0>:gen_mod:47): {undef,[{mod_xmlrpc,
start,
["sklyar.idegp.com",
[{port,4560},{timeout,5000}]]},
{gen_mod,start_module,3},
{lists,foreach,2},
{ejabberd_app,start,2},
{application_master,start_it_old,4}]}

and again I don't understand what does it mean?

In russia:

Сегодня я внимательнее почитал документацию и обнаружил, что ejabberd имеет встроенный модуль xmlrpc,
но раскомментировав необходимую строку в ejabberd.cfg и стартовав сервер я снова обнаруджил ошибку в логах.

Что же это такое? Как вообще расшифровывать ошибки erlang?

Кто нибудь вообще запустил модуль mod_xmlrpc?

Badlop and I solved this

Badlop and I solved this problem.

To get work mod_xmlrpc we need to place files in the following way:

\lib
-\ejabberd-1.1.3
--\ebin
---\mod_xmlrpc.beam
-\xmlrpc-1.13_p1
--\ebin
---\mod_xmlrpc.beam
---\tcp_serv.beam
---\ucs.app
---\ucs.beam
---\ucs_app.beam
---\ucs_data.beam
---\ucs_data_build.beam
---\ucs_sup.beam
---\xmerl.app
---\xmerl.beam
---\xmerl_eventp.beam
---\xmerl_html.beam
---\xmerl_lib.beam
---\xmerl_otpsgml.beam
---\xmerl_scan.beam
---\xmerl_sgml.beam
---\xmerl_simple.beam
---\xmerl_text.beam
---\xmerl_validate.beam
---\xmerl_xlate.beam
---\xmerl_xml.beam
---\xmerl_xpath.beam
---\xmerl_xpath_parse.beam
---\xmerl_xpath_pred.beam
---\xmerl_xpath_scan.beam
---\xmerl_xs.beam
---\xmlrpc.beam
---\xmlrpc_decode.beam
---\xmlrpc_encode.beam
---\xmlrpc_http.beam
---\xmlrpc_util.beam
-\xmerl-1.0.5
--\ebin
---\xmerl.app
---\xmerl.appup
---\xmerl.beam
---\xmerl_eventp.beam
---\xmerl_html.beam
---\xmerl_lib.beam
---\xmerl_otpsgml.beam
---\xmerl_scan.beam
---\xmerl_sgml.beam
---\xmerl_simple.beam
---\xmerl_text.beam
---\xmerl_ucs.beam
---\xmerl_uri.beam
---\xmerl_validate.beam
---\xmerl_xlate.beam
---\xmerl_xml.beam
---\xmerl_xpath.beam
---\xmerl_xpath_parse.beam
---\xmerl_xpath_pred.beam
---\xmerl_xpath_scan.beam
---\xmerl_xs.beam

and in
\conf
-\ejabberd.cfg

uncomment line

{mod_xmlrpc,[{port, 4560},{timeout, 5000}]},

Syndicate content