i recently installed xmerl 0.20, xml-rpc-Erlang 1.13 and finally mod_xmlrpc to my ejabberd installation.
the xml-rpc-server is now up and seems to run fine. but if a XML-RPC-Request comes in, following error will occur and will return nothing to the xml-rpc-client:
=CRASH REPORT==== 11-Aug-2006::05:48:50 === crasher: pid: <0.410.0> registered_name: [] error_info: {badarg,[{xmlrpc_decode,decode_params,1}, {xmlrpc_decode,decode_element,1}, {xmlrpc_decode,payload,1}, {xmlrpc_http,handle_payload,5}, {tcp_serv,start_session,3}, {proc_lib,init_p,5}]} initial_call: {tcp_serv,start_session, [<0.258.0>, {xmlrpc_http, handler, [50,{mod_xmlrpc,handler},started]}, #Port<0.332>]} ancestors: [<0.258.0>,<0.41.0>] messages: [] links: [<0.258.0>,#Port<0.724>] dictionary: [] trap_exit: false status: running heap_size: 987 stack_size: 21 reductions: 1471 neighbours:
i'm new to erlang. i'm not sure if this error means, that the count of arguments to "handler" in xmlrpc_http is wrong?! did i get the wrong xmlrpc_http-version maybe?
xmlrpc_http.erl says:
-export([handler/4]). [..] %% Exported: handler/3 handler(Socket, Timeout, Handler, State) -> case parse_request(Socket, Timeout) of {ok, Header} -> ?DEBUG_LOG({header, Header}), handle_payload(Socket, Timeout, Handler, State, Header); {status, StatusCode} -> send(Socket, StatusCode), handler(Socket, Timeout, Handler, State); {error, Reason} -> {error, Reason} end.
this will export the function with 4 arguments, comment says 3, but actually has 4 arguments?
maybe anyone can help me with my problem.
thanks.
flip
The error is on decoding parameters
The error says that: {badarg,[{xmlrpc_decode,decode_params,1},
That means that when the function xmlrpc_decode:decode_params/1 was called, a 'badarg' type of error was found in it. It seems there was a problem decoding the parameters.
Regarding handler, it seems the comment is wrong, probably outdated, but that isn't the issue at all.
What version of Erlang? Did you follow strictly the installation instructions provided with mod_xmlrpc? Did the examples work?
problem solved
i've tested the xmlrpc-query-examples from the docs and they've worked. the problem was a malformed xml-query.
notice: i had to replace the brackets for pasting. it's <>, not [] !
my first query caused the error:
[?xml version="1.0"?]
[methodCall]
[methodName]echothis[/methodName]
[params]test[/params]
[/methodCall]
my new query works fine:
[?xml version="1.0" encoding="UTF-8"?]
[methodCall]
[methodName]echothis[/methodName]
[params]
[param]
[value][string]test[/string][/value]
[/param]
[/params]
[/methodCall]
thanks for your help, badlop.
flip