I have recently completed an xml_rpc client development using Borland C++.
The simple commands like echothis and multhis work fine, but I cannot query connected_users.
When I run the command from the Erlang Eshell V5.6.4 I:
xmlrpc:call({127, 0, 0, 1}, 4560, "/", {call, connected_users, []}).
xmlrpc:call({127, 0, 0, 1}, 4560, "/", {call, create_account, [{struct, [{user, "ggeo"}, {host, "austinmobile"}, {password, "gogo11"}]}]}).
I get the error:-
{ok,{response,{fault,-112,"Error -112\nUnknown call: {call,connected_users,[]}"}}}
{ok,{response,{fault,-112,"Error -112\nUnknown call: {call,create_account,\n[{struct,[{user,\"ggeo\"},\n
{host,\"austinmobile\"},\n {password,\"gogo11\"}]}]}"}}}
Settings are from a fresh ejabberd install with ejabberd_xmlrpc installed.
{4560, ejabberd_xmlrpc, [{maxsessions, 10}, {timeout, 5000}]},
I suspect that this is an access issue as these calls do not work on xmlrpc either.
Any help for this new user would be appreciatted.
AndyA from SA
The problem with the first
The problem with the first call is that ejabberd_xmlrpc expects a struct, even when there are no command arguments to provide:
The problem with the second call is that you are calling a command that doesn't exist. Maybe it existed in an old version of the module.
Try this one instead:
You can get information about the available commands by calling in your shell:
Many Thanks for your Help
I submitted a thanks earlier but it is not visible.
Thanks for your help.
AndyA from SA
empty struct?
Hi
The problem with the first call is that ejabberd_xmlrpc expects a struct, even when there are no command arguments to provide:
Can we avoid using the empty structure?
Because I don't know how to create it in my php client. (I tried array(), array(null), array("")... nothing worked)
An other problem is I can make the authentication work.
I'm running ejabberd 2.1.4 (from bin installer).
Compiled ejabberd_xmlrpc (puts the beams ine ejabberd/lib/ejabberd-xxx).
Compiled xmerl from R12B-5 (puts the beams in ejabberd/lib/kernel-xxx)
When I run every command I get a -118 error.
Ex:
Did I something wrong?
Thx
Vincent
Empty struct now optional. Verify your auth info
Can we avoid using the empty structure?
Yes, I've modified the source code in SVN. Now that empty struct is optional.
17> xmlrpc:call({127, 0, 0, 1}, 4560, "/", {call, stats, [
{struct, [{user, "adminjabber"}, {server, "192.168.67.123"}, {password, "pass"}]},
{struct, [{name, "onlineusers"}]}]}).
{ok,{response,{fault,-118,
"Error -118\nA problem '{error,invalid_account_data}'
You must provide auth information of a local Jabber account.
Can you login to the Jabber account adminjabber@192.168.67.123
with password "pass" in ejabberd, using a Jabber client?
Example:
(ejabberd@localhost)7>
xmlrpc:call({127, 0, 0, 1}, 4560, "/", {call, stats, [
{struct, [{user, "badlop"}, {server, "localhost"}, {password, "mypass123"}]},
{struct, [{name, "onlineusers"}]}]}).
{ok,{response,[{struct,[{stat,1}]}]}}
BTW, I've added example PHP code in README.txt on how to provide that auth information.
thanks
Yes, I've modified the source code in SVN. Now that empty struct is optional.
It works. Thank you!
You must provide auth information of a local Jabber account.
Can you login to the Jabber account adminjabber@192.168.67.123
with password "pass" in ejabberd, using a Jabber client?
Yes with pidgin I can login this account to the server. Maybe my config is wrong. I have this :