Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ejabberd xmlrpc configuration error

Tags:

ejabberd

ejabberd version: 16.04
OS: CentOS 7

I followed this document to setup xmlrpc support and need some help to configure access control: https://www.ejabberd.im/ejabberd_xmlrpc

I was just trying to setup the simple config following the example: XML-RPC calls can execute any command, with any argument, and no authentication information must be provided.

Here is my config file .yml:

listen:
  -
    port: 4560
    module: ejabberd_xmlrpc
    maxsessions: 10
    timeout: 5000

Based on the document, I shouldn't need to do anything else.

Here is my client side java code:

XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
URL url = new URL("http://myhost:4560/");
config.setServerURL(url);
XmlRpcClient client = new XmlRpcClient();
client.setConfig(config);
String command = "status";
Map struct = new HashMap();
Object[] params = new Object[] { struct };
Object result = client.execute(command, params);

however, I got this error on both client side and server side log:

2016-05-17 22:37:00.553 [warning] <0.498.0>@ejabberd_xmlrpc:build_fault_response:386 Error -118
A problem '{error,account_unprivileged}' occurred executing the command status with arguments
[]

I tried to add admin username and password in the client configuration call and still failed.

I think I'm missing something very basic. Any help is appreciated.

--Nathan

like image 906
Nathan Avatar asked Apr 07 '26 09:04

Nathan


1 Answers

This workis for me:

-
 port: 4560
 module: ejabberd_xmlrpc
 maxsessions: 10
 timeout: 5000
 access_commands: []

You have to specify access_comands to an empty list

like image 137
Elisio L Leonardo Avatar answered Apr 21 '26 01:04

Elisio L Leonardo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!