| Author |
Message |
|
| Guest |
Posted: Mon Jan 04, 2010 7:30 pm |
|
|
|
Guest
|
It's disappointing that the xmlrpc components aren't distributed in a single, compiled package...
Having installed the compiled erlang xmlrpc module, I see ejabberd_xmlrpc isn't distributed as a .beam... Any pointers to one? Or can I compile from WinXP command line?
There's a bin (but no ebin) directory in my WinXP ejabberd directory... Same as ebin?
I want ANY XMLRPC client to be able to use ONLY the register command... Is this the config for that:
|
|
|
| Back to top |
|
| Guest |
Posted: Tue Jan 05, 2010 5:21 pm |
|
|
|
Guest
|
2010/1/4 Liam <ejabberd@networkimprov.net>:
> I want ANY XMLRPC client to be able to use ONLY the register command... Is
> this the config for that:
>
> {4560, ejabberd_xmlrpc, [{access_commands, [{all, [register], []}]}]},
That configuration seems correct.
Also note that the Guide says [1]:
> If at least one restriction is defined, then the frontend expects that
> authentication information is provided when executing a command.
That means you will have to provide auth of some Jabber account inside
the XMLRPC
calls. All accounts are accepted, so in your case, an easy solution is
to create a dummy account in ejabberd like dummyxmlrpc@yourjabber.net
and then provide this in the XMLRPC calls.
> can I compile from WinXP command line?
There may be some way. The Windows installer of ejabberd includes the
compiler erlc, and also make.beam, and SVN of ejabberd_xmlrpc has
build.bat
Maybe some Windows developer can give some additional hint, if there
is anyone out there.
You can also compile the files in Linux, FreeBSD, MacOSX, and copy the
beam to your Windows machine.
> There's a bin (but no ebin) directory in my WinXP ejabberd directory... Same
> as ebin?
Not the same. Erlang binary files for ejabberd should go in a dir like
C:\ejabberd-2.1.1\lib\ejabberd-2.1.1\ebin
[1] http://svn.process-one.net/ejabberd/branches/ejabberd-2.1.x/doc/guide.html#accesscommands
---
Badlop
ProcessOne
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Tue Jan 05, 2010 7:57 pm |
|
|
|
Guest
|
Any chance I can persuade you guys to rev ejabberd_xmlrpc to include the erlang xmlrpc source (with a make file that puts all the beam files in a single dir, and install instructions to put that dir into ejabberd/lib), and release a compiled package?
>> can I compile from WinXP command line?
>
>There may be some way. The Windows installer of ejabberd includes the
>compiler erlc, and also make.beam, and SVN of ejabberd_xmlrpc has
>build.bat
>
>Maybe some Windows developer can give some additional hint, if there
>is anyone out there.
>
>You can also compile the files in Linux, FreeBSD, MacOSX, and copy the
>beam to your Windows machine.
>
>
>> There's a bin (but no ebin) directory in my WinXP ejabberd directory... Same
>> as ebin?
>
>Not the same. Erlang binary files for ejabberd should go in a dir like
>C:\ejabberd-2.1.1\lib\ejabberd-2.1.1\ebin
On Mon, Jan 4, 2010 at 11:30 AM, Liam <ejabberd@networkimprov.net (ejabberd@networkimprov.net)> wrote:
Quote: It's disappointing that the xmlrpc components aren't distributed in a single, compiled package...
Having installed the compiled erlang xmlrpc module, I see ejabberd_xmlrpc isn't distributed as a .beam... Any pointers to one? Or can I compile from WinXP command line?
There's a bin (but no ebin) directory in my WinXP ejabberd directory... Same as ebin?
I want ANY XMLRPC client to be able to use ONLY the register command... Is this the config for that:
|
|
|
| Back to top |
|
| Guest |
Posted: Thu Jan 07, 2010 7:52 pm |
|
|
|
Guest
|
Installed ejabberd on Linux in order to build ejabberd_xmlrpc...
Its build.sh and Emakefile have refs to ejabberd-dev/trunk/..., which is not in my installation!
Help. (I checked modules/README.txt but it doesn't clarify)
On Mon, Jan 4, 2010 at 11:30 AM, Liam <ejabberd@networkimprov.net (ejabberd@networkimprov.net)> wrote:
Quote: It's disappointing that the xmlrpc components aren't distributed in a single, compiled package...
Having installed the compiled erlang xmlrpc module, I see ejabberd_xmlrpc isn't distributed as a .beam... Any pointers to one? Or can I compile from WinXP command line?
There's a bin (but no ebin) directory in my WinXP ejabberd directory... Same as ebin?
I want ANY XMLRPC client to be able to use ONLY the register command... Is this the config for that:
|
|
|
| Back to top |
|
| Guest |
Posted: Thu Jan 07, 2010 8:04 pm |
|
|
|
Guest
|
2010/1/7 Liam <ejabberd@networkimprov.net>:
> Installed ejabberd on Linux in order to build ejabberd_xmlrpc...
>
> Its build.sh and Emakefile have refs to ejabberd-dev/trunk/..., which is not
> in my installation!
>
> Help. (I checked modules/README.txt but it doesn't clarify)
You don't need full ejabberd source code to compile one of those modules.
But you need to download all the ejabberd-modules SVN.
Check this tutorial:
http://www.ejabberd.im/ejabberd-modules
You will need Erlang/OTP and SVN installed.
If you have Debian, Ubuntu or related Linux distribution, you can
install them with:
apt-get install subversion erlang erlang-dev
---
Badlop
ProcessOne
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Thu Jan 07, 2010 8:16 pm |
|
|
|
Guest
|
Can I do something like this?
|
|
|
| Back to top |
|
| Guest |
Posted: Thu Jan 07, 2010 8:28 pm |
|
|
|
Guest
|
2010/1/7 Liam <ejabberd@networkimprov.net>:
> Can I do something like this?
>
> |
|
|
| Back to top |
|
| Guest |
Posted: Thu Jan 07, 2010 8:45 pm |
|
|
|
Guest
|
Doesn't seem to work...
$ cd ejabberd-2.1.1
$ bin/erlc -I includes lib/xmlrpc/ejabberd_xmlrpc.erl
lib/xmlrpc/ejabberd_xmlrpc.erl:25: can't find include file "ejabberd.hrl"
lib/xmlrpc/ejabberd_xmlrpc.erl:26: can't find include file "mod_roster.hrl"
lib/xmlrpc/ejabberd_xmlrpc.erl:27: can't find include file "jlib.hrl"
lib/xmlrpc/ejabberd_xmlrpc.erl:325: undefined macro ''WARNING_MSG''
lib/xmlrpc/ejabberd_xmlrpc.erl:241: function build_fault_response/3 undefined
Jeez, this has been frustrating...
Could you email me the xmlrpc.beam you just compiled?
On Thu, Jan 7, 2010 at 12:16 PM, Liam <ejabberd@networkimprov.net (ejabberd@networkimprov.net)> wrote:
Quote: Can I do something like this?
|
|
|
| Back to top |
|
| Guest |
Posted: Thu Jan 07, 2010 9:14 pm |
|
|
|
Guest
|
Spoke too soon! This works:
$ cd ejabberd-2.1.1
$ bin/erlc -I includes/ejabberd/include some_path/ejabberd_xmlrpc.erl
Thank heavens. And thanks for your help!
On Thu, Jan 7, 2010 at 12:44 PM, Liam <ejabberd@networkimprov.net (ejabberd@networkimprov.net)> wrote:
Quote: Doesn't seem to work...
$ cd ejabberd-2.1.1
$ bin/erlc -I includes lib/xmlrpc/ejabberd_xmlrpc.erl
lib/xmlrpc/ejabberd_xmlrpc.erl:25: can't find include file "ejabberd.hrl"
lib/xmlrpc/ejabberd_xmlrpc.erl:26: can't find include file "mod_roster.hrl"
lib/xmlrpc/ejabberd_xmlrpc.erl:27: can't find include file "jlib.hrl"
lib/xmlrpc/ejabberd_xmlrpc.erl:325: undefined macro ''WARNING_MSG''
lib/xmlrpc/ejabberd_xmlrpc.erl:241: function build_fault_response/3 undefined
Jeez, this has been frustrating...
Could you email me the xmlrpc.beam you just compiled?
On Thu, Jan 7, 2010 at 12:16 PM, Liam <ejabberd@networkimprov.net (ejabberd@networkimprov.net)> wrote:
Quote: Can I do something like this?
|
|
|
| Back to top |
|
| Guest |
Posted: Thu Jan 07, 2010 9:24 pm |
|
|
|
Guest
|
2010/1/7 Liam <ejabberd@networkimprov.net>:
> Could you email me the xmlrpc.beam you just compiled?
No, because I have Erlang R13, and ejabberd 2.1.1 installers use R12.
> Jeez, this has been frustrating...
Just a little more, and you will be able to compile any ejabberd
module yourself.
> Doesn't seem to work...
>
> $ cd ejabberd-2.1.1
> $ bin/erlc -I includes lib/xmlrpc/ejabberd_xmlrpc.erl
> lib/xmlrpc/ejabberd_xmlrpc.erl:25: can't find include file "ejabberd.hrl"
> lib/xmlrpc/ejabberd_xmlrpc.erl:26: can't find include file "mod_roster.hrl"
> lib/xmlrpc/ejabberd_xmlrpc.erl:27: can't find include file "jlib.hrl"
> lib/xmlrpc/ejabberd_xmlrpc.erl:325: undefined macro ''WARNING_MSG''
> lib/xmlrpc/ejabberd_xmlrpc.erl:241: function build_fault_response/3
> undefined
Try:
$ bin/erlc -I includes/ejabberd/include lib/xmlrpc/ejabberd_xmlrpc.erl
---
Badlop
ProcessOne
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Thu Jan 07, 2010 10:13 pm |
|
|
|
Guest
|
Documented this build technique at ejabberd.im:
http://www.ejabberd.im/ejabberd-modules#comment-55101
Let me know if that needs any changes...
On Thu, Jan 7, 2010 at 1:11 PM, Liam <ejabberd@networkimprov.net (ejabberd@networkimprov.net)> wrote:
Quote: Spoke too soon! This works:
$ cd ejabberd-2.1.1
$ bin/erlc -I includes/ejabberd/include some_path/ejabberd_xmlrpc.erl
Thank heavens. And thanks for your help!
On Thu, Jan 7, 2010 at 12:44 PM, Liam <ejabberd@networkimprov.net (ejabberd@networkimprov.net)> wrote:
Quote: Doesn't seem to work...
$ cd ejabberd-2.1.1
$ bin/erlc -I includes lib/xmlrpc/ejabberd_xmlrpc.erl
lib/xmlrpc/ejabberd_xmlrpc.erl:25: can't find include file "ejabberd.hrl"
lib/xmlrpc/ejabberd_xmlrpc.erl:26: can't find include file "mod_roster.hrl"
lib/xmlrpc/ejabberd_xmlrpc.erl:27: can't find include file "jlib.hrl"
lib/xmlrpc/ejabberd_xmlrpc.erl:325: undefined macro ''WARNING_MSG''
lib/xmlrpc/ejabberd_xmlrpc.erl:241: function build_fault_response/3 undefined
Jeez, this has been frustrating...
Could you email me the xmlrpc.beam you just compiled?
On Thu, Jan 7, 2010 at 12:16 PM, Liam <ejabberd@networkimprov.net (ejabberd@networkimprov.net)> wrote:
Quote: Can I do something like this?
|
|
|
| Back to top |
|
| Guest |
Posted: Thu Jan 07, 2010 10:47 pm |
|
|
|
Guest
|
>Also note that the Guide says [1]:
> If at least one restriction is defined, then the frontend expects that
> authentication information is provided when executing a command.
>
>That means you will have to provide auth of some Jabber account inside the XMLRPC calls.
I don't see from the xmlrpc readme how to include authentication in an xmlrpc call.
My xmlrpc text looks like:
<methodcall>
|
|
|
| Back to top |
|
| Guest |
Posted: Fri Jan 08, 2010 6:16 am |
|
|
|
Guest
|
On deeper inspection, I gather an authentication struct comes before a command struct, so my xmlrpc msg is:
<methodcall>
<methodname>register</methodname>
<params><param><value><struct>
<member><name>user</name><value><string>xmlrpc_access</string></value></member>
<member><name>server</name><value><string>localhost</string></value></member>
<member><name>password</name><value><string>pass</string></value></member>
</struct></value></param><param><value><struct>
<member><name>user</name><value><string>newuser</string></value></member>
<member><name>host</name><value><string>localhost</string></value></member>
<member><name>password</name><value><string>newpass</string></value></member>
</struct></value></param></params></methodcall>
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?
On Thu, Jan 7, 2010 at 2:47 PM, Liam <ejabberd@networkimprov.net (ejabberd@networkimprov.net)> wrote:
Quote: >Also note that the Guide says [1]:
> If at least one restriction is defined, then the frontend expects that
> authentication information is provided when executing a command.
>
>That means you will have to provide auth of some Jabber account inside the XMLRPC calls.
I don't see from the xmlrpc readme how to include authentication in an xmlrpc call.
My xmlrpc text looks like:
<methodcall>
|
|
|
| Back to top |
|
| Guest |
Posted: Fri Jan 08, 2010 4:24 pm |
|
|
|
Guest
|
2010/1/8 Liam <ejabberd@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@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@localhost succesfully registered</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
---
Badlop
ProcessOne
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Fri Jan 08, 2010 10:49 pm |
|
|
|
Guest
|
Thanks for the config and HTTP traffic details...
Having mirrored those, I'm still getting HTTP result 415. The ejabberd log is telling me:
=ERROR REPORT==== 2010-01-08 14:44:51 ===
{tcp_serv,139,{xmlrpc_http,handler,timeout}}
Which sorta implies the xmlrpc module isn't reaching ejabberd_xmlrpc?
On Thu, Jan 7, 2010 at 10:16 PM, Liam <ejabberd@networkimprov.net (ejabberd@networkimprov.net)> wrote:
Quote: On deeper inspection, I gather an authentication struct comes before a command struct, so my xmlrpc msg is:
<methodcall>
<methodname>register</methodname>
<params><param><value><struct>
<member><name>user</name><value><string>xmlrpc_access</string></value></member>
<member><name>server</name><value><string>localhost</string></value></member>
<member><name>password</name><value><string>pass</string></value></member>
</struct></value></param><param><value><struct>
<member><name>user</name><value><string>newuser</string></value></member>
<member><name>host</name><value><string>localhost</string></value></member>
<member><name>password</name><value><string>newpass</string></value></member>
</struct></value></param></params></methodcall>
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?
On Thu, Jan 7, 2010 at 2:47 PM, Liam <ejabberd@networkimprov.net (ejabberd@networkimprov.net)> wrote:
Quote: >Also note that the Guide says [1]:
> If at least one restriction is defined, then the frontend expects that
> authentication information is provided when executing a command.
>
>That means you will have to provide auth of some Jabber account inside the XMLRPC calls.
I don't see from the xmlrpc readme how to include authentication in an xmlrpc call.
My xmlrpc text looks like:
<methodcall>
|
|
|
| Back to top |
|
|
|
All times are GMT
Page 1 of 2
Goto page 1, 2 Next
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|