[ejabberd] xmlrpc compiled?

Badlop badlop at gmail.com
Fri Jan 8 19:24:26 MSK 2010


2010/1/8 Liam <ejabberd at networkimprov.net>:
> However, I'm getting back an empty response with HTTP result 415 (invalid
> media). The headers:
>
> Server: nginx/0.7.62
> Date: Fri, 08 Jan 2010 05:59:38 GMT
> Content-Type: text/xml
> Connection: keep-alive
> Content-Length: 0
>
> (I proxy the request via nginx; I'm sure it's handing it on.)
>
> Ideas?


In ejabberd.cfg:
{listen, [
  ...
  {4560, ejabberd_xmlrpc, [
        {access_commands, [
            {all, [register], [ {host, "localhost"} ]}
        ]}
  ]}

]}.


Then I use an erlang XMLRPC client:

cd xmlrpc-1.13/ebin
$ erl
Erlang R13B03 (erts-5.7.4) [source] [smp:2:2] [rq:2] [async-threads:0]
[hipe] [kernel-poll:false]

Eshell V5.7.4  (abort with ^G)
1> xmlrpc:call({127, 0, 0, 1}, 4560, "/", {call, register,[
  {struct, [{user, "badlop"}, {server, "localhost"}, {password, "mypass"}]},
  {struct, [{user, "testuser"}, {host, "localhost"}, {password,
"testpass"}]}]}).

{ok,{response,[{struct,[{res,0},{text,"User testuser at localhost
succesfully registered"}]}]}}



I sniffed the network traffic, it is like this. The client sends:

POST / HTTP/1.1
Content-Length: 538
User-Agent: Erlang XML-RPC Client 1.13
Content-Type: text/xml
Connection: close

<?xml version="1.0"?>
<methodCall>
    <methodName>register</methodName>
    <params>
        <param>
            <value>
                <struct>
                    <member>
                        <name>user</name><value>badlop</value>
                    </member>
                    <member>
                        <name>server</name><value>localhost</value>
                    </member>
                    <member>
                        <name>password</name><value>mypass</value>
                    </member>
                </struct>
            </value>
        </param>
        <param>
            <value>
                <struct>
                    <member>
                        <name>user</name><value>testuser</value>
                    </member>
                    <member>
                        <name>host</name><value>localhost</value>
                    </member>
                    <member>
                        <name>password</name><value>testpass</value>
                    </member>
                </struct>
            </value>
        </param>
    </params>
</methodCall>

And receives:

HTTP/1.1 200 OK
Content-Length: 273
Server: Erlang/1.13
Content-Type: text/xml
Connection: close

<?xml version="1.0"?>
<methodResponse>
    <params>
        <param>
            <value>
                <struct>
                    <member>
                        <name>res</name>
                        <value>
                            <int>0</int>
                        </value>
                    </member>
                    <member>
                        <name>text</name><value>User
testuser at localhost succesfully registered</value>
                    </member>
                </struct>
            </value>
        </param>
    </params>
</methodResponse>


---
Badlop
ProcessOne


More information about the ejabberd mailing list