ejabberd - Comments for "mod_xmlrpc - XML-RPC Server" https://www.ejabberd.im/mod_xmlrpc en send message to user https://www.ejabberd.im/mod_xmlrpc#comment-67654 <p>I am having issue while sending message to user through RPC2. if any one have suggestion please let me know.</p> Fri, 08 Sep 2017 04:37:34 +0000 gauravtayal_appster comment 67654 at https://www.ejabberd.im How to compile xmlrpc-1.13-ipr2 for windows? https://www.ejabberd.im/mod_xmlrpc#comment-64032 <p>I am trying to compile it for windows, but this tutorial below don't work:</p> <p>1. You need to get and install XMLRPC-Erlang.<br /> You can download XMLRPC-Erlang binary files from<br /> <a href="http://www.ejabberd.im/ejabberd_xmlrpc" title="http://www.ejabberd.im/ejabberd_xmlrpc">http://www.ejabberd.im/ejabberd_xmlrpc</a><br /> or compile it yourself:<br /> wget <a href="http://www.ejabberd.im/files/contributions/xmlrpc-1.13-ipr2.tgz" title="http://www.ejabberd.im/files/contributions/xmlrpc-1.13-ipr2.tgz">http://www.ejabberd.im/files/contributions/xmlrpc-1.13-ipr2.tgz</a><br /> tar -xzvf xmlrpc-1.13-ipr2.tgz<br /> cd xmlrpc-1.13/src<br /> make<br /> cd ../../<br /> Then you can copy the *.beam files to ejabberd ebin directory,<br /> or add an option like this to the ejabberd start script:<br /> $ erl -pa '/home/jabber/xmlrpc-1.13/ebin' ...</p> <p>Make command don't work. Is There a way to compile this module in Windows?</p> Fri, 23 May 2014 14:16:06 +0000 icaro56 comment 64032 at https://www.ejabberd.im ProtocolError in python https://www.ejabberd.im/mod_xmlrpc#comment-54589 <div class="codeblock"><code>import xmlrpclib <p>print &quot;hello&quot;</p> <p># Create an object to represent our server.<br />server_url = &#039;http://127.0.0.1:4560&#039;;<br />server = xmlrpclib.Server(server_url);</p> <p># Call the server and get our result.<br />try:<br />&nbsp;&nbsp;&nbsp; result = server.echothis(&quot;800&quot;)<br />&nbsp;&nbsp;&nbsp; print result<br />except xmlrpclib.ProtocolError, err:<br />&nbsp;&nbsp;&nbsp; print &quot;A protocol error occurred&quot;<br />&nbsp;&nbsp;&nbsp; print &quot;URL: %s&quot; % err.url<br />&nbsp;&nbsp;&nbsp; print &quot;HTTP/HTTPS headers: %s&quot; % err.headers<br />&nbsp;&nbsp;&nbsp; print &quot;Error code: %d&quot; % err.errcode<br />&nbsp;&nbsp;&nbsp; print &quot;Error message: %s&quot; % err.errmsg</p></code></div> <p>I obtain:</p> <pre> hello A protocol error occurred URL: 127.0.0.1:4560/RPC2 HTTP/HTTPS headers: None Error code: -1 Error message: </pre><p>I have the version 2.0.5, compiled myself the mod_xmlrpc (thus with erlang version 5.6.5) and got compiled .beams from the upload in this page for erlang-xmlrpc (thank you badlop) thus with erlang version r12b5-5.6.5 too.<br /> I'm on windows.<br /> Does anyone have an idea for the reason of that or how can I debug this?</p> Wed, 26 Aug 2009 22:52:15 +0000 NecmiKara comment 54589 at https://www.ejabberd.im Java example and PHP committed https://www.ejabberd.im/mod_xmlrpc#comment-53523 <p>Thanks, I've added your Java example, and fixed the PHP example.</p> Sun, 31 Aug 2008 18:18:13 +0000 mfoss comment 53523 at https://www.ejabberd.im Wrong PHP example https://www.ejabberd.im/mod_xmlrpc#comment-53499 <p>README.txt for mod_xmlrpc contains not working PHP example, due to improper request headers. Here is the code that works:</p> <pre> $param = array("user"=&gt;"test_user","host"=&gt;"example.com","password"=&gt;"some_password"); $request = xmlrpc_encode_request('check_password', $param, (array('encoding' =&gt; 'utf-8'))); $context = stream_context_create(array('http' =&gt; array( 'method' =&gt; "POST", 'header' =&gt; "User-Agent: XMLRPC::Client mod_xmlrpc\r\n" . "Content-Type: text/xml\r\n" . "Content-Length: ".strlen($request), 'content' =&gt; $request ))); $file = file_get_contents('http://127.0.0.1:4560/RPC2', false, $context); $response = xmlrpc_decode($file); if (xmlrpc_is_fault($response)) { trigger_error("xmlrpc: $response[faultString] ($response[faultCode])"); } else { print_r($response); } </pre><p>You must also remember to set "allow_url_fopen = On" in the php.ini.</p> Fri, 22 Aug 2008 11:48:33 +0000 calder comment 53499 at https://www.ejabberd.im Java example https://www.ejabberd.im/mod_xmlrpc#comment-53502 <p>Here's Java example client for mod_xmlrpc:</p> <pre> import java.net.URL; import java.util.HashMap; import java.util.Map; import org.apache.xmlrpc.client.XmlRpcClient; import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; public class Test { public static void main(String[] args) { try { XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(new URL("http://127.0.0.1:4560/RPC2")); XmlRpcClient client = new XmlRpcClient(); client.setConfig(config); /* Command string */ String command = "check_password"; /* Parameters as struct */ Map struct = new HashMap(); struct.put("user", "test1"); struct.put("host", "localhost"); struct.put("password", "test"); Object[] params = new Object[]{struct}; Integer result = (Integer) client.execute(command, params); System.out.println(result); } catch (Exception e) { System.out.println(e); } } } </pre><p> Requires Apache XML-RPC available at <noindex><a href="http://ws.apache.org/xmlrpc/" title="http://ws.apache.org/xmlrpc/" rel="nofollow" >http://ws.apache.org/xmlrpc/</a></noindex></p> Fri, 22 Aug 2008 11:47:49 +0000 calder comment 53502 at https://www.ejabberd.im Have you solved it yet? https://www.ejabberd.im/mod_xmlrpc#comment-53388 <p>edit: Apologies, this was meant to be in reply to wina's post "couldn't run mod_xmlrpc on my localhost"</p> <p>I am running into the same problem were you able to find a solution? Thank you</p> Tue, 08 Jul 2008 19:49:10 +0000 ejab comment 53388 at https://www.ejabberd.im had xmerl installed https://www.ejabberd.im/mod_xmlrpc#comment-52262 <p>i have xmerl-1.1.4\ebin\*.beam files and xmlrpc-1.13\ebin\xmlrpc.beam file inside my lib directory.<br /> i didnt pass the parameter, with your information i tried to add it but still doesn't work.</p> <p>my bin\ejabberdctl configuration looks like below.</p> <p>EJABBERD_XMERL="$ROOTDIR/lib/xmerl-1.1.4/ebin"</p> <p># start server<br /> start()<br /> {<br /> exec $ERL $NAME $ERLANG_NODE $ERLANG_OPTS \<br /> -pa $EJABBERD_XMERL \<br /> -noinput -detached \<br /> -mnesia dir "\"$EJABBERD_DB\"" \<br /> -s ejabberd \<br /> -ejabberd config \"$EJABBERD_CONFIG_PATH\" \<br /> log_path \"$EJABBERD_LOG_PATH\" \<br /> -sasl sasl_error_logger \{file,\"$SASL_LOG_PATH\"\}<br /> }</p> <p>did i set it wrong?</p> Fri, 25 Apr 2008 09:31:34 +0000 wina comment 52262 at https://www.ejabberd.im Installed XMLERL-1.3 https://www.ejabberd.im/mod_xmlrpc#comment-52257 <p>Have you installed xmlerl-1.3?</p> <p>Do you in your start up script for ejabberd pass the -pa '/path/to/xmlerl/ebin' parameter to it??</p> <p>This was what caused me not to be able to run it, i did not have in the startup the -pa and i modified the ejabberdctl file to add it as a configuration parameter for startup.</p> Thu, 24 Apr 2008 17:33:28 +0000 darren.ferguson comment 52257 at https://www.ejabberd.im couldn't run mod_xmlrpc on my localhost https://www.ejabberd.im/mod_xmlrpc#comment-52254 <p>hi,</p> <p>I still couldnt install this module on my localhost(Window)<br /> anybody could help? thanks in advance.</p> <p>=ERROR REPORT==== 2008-04-24 14:16:15 ===<br /> E(&lt;0.36.0&gt;:gen_mod:66) : {undef,[{mod_xmlrpc,start,["localhost",[]]},<br /> {gen_mod,start_module,3},<br /> {lists,foreach,2},<br /> {ejabberd_app,start,2},<br /> {application_master,start_it_old,4}]}</p> Thu, 24 Apr 2008 05:40:51 +0000 wina comment 52254 at https://www.ejabberd.im It works now... https://www.ejabberd.im/mod_xmlrpc#comment-51413 <p>The problem was that the /lib/ejabberd-1.1.4/ebin directory was missing the UCS app and beam files.<br /> Once I dropped those in, things started to work fine.</p> <p>Thanks/Prasad</p> Tue, 04 Dec 2007 19:45:28 +0000 Prasad Panchangam comment 51413 at https://www.ejabberd.im Receiving {error, closed} when I test xmlrpc https://www.ejabberd.im/mod_xmlrpc#comment-51403 <p>my config:<br /> fedora Core 6<br /> erlang-R11B-2.3.fc6<br /> ejabberd 1.1.4<br /> xmerl-0.20<br /> xmlrpc-1.13-ipr2</p> <p>/conf/ejabberd.cfg contains the following line:<br /> {mod_xmlrpc,[{port, 4560},{timeout, 60000}]}</p> <p>contents of directory /ejabberd-1.1.4/lib/ejabberd-1.1.4/ebin:</p> <p>acl.beam ejabberd_auth_odbc.beam ejabberd_s2s.beam extauth.beam mod_last.beam mod_sms.beam tcp_serv.beam xmerl_xlate.beam<br /> adhoc.beam ejabberd.beam ejabberd_s2s_in.beam gen_iq_handler.beam mod_last_odbc.beam mod_stats.beam tls.beam xmerl_xml.beam<br /> configure.beam ejabberd_c2s.beam ejabberd_s2s_out.beam gen_mod.beam mod_muc.beam mod_time.beam translate.beam xmerl_xpath.beam<br /> cyrsasl_anonymous.beam ejabberd_config.beam ejabberd_service.beam iconv.beam mod_muc_log.beam mod_vcard.beam transliteration.beam xmerl_xpath_parse.beam<br /> cyrsasl.beam ejabberd_ctl.beam ejabberd_sm.beam idna.beam mod_muc_room.beam mod_vcard_ldap.beam xmerl.app xmerl_xpath_pred.beam<br /> cyrsasl_digest.beam ejabberd_hooks.beam ejabberd_sup.beam jd2ejd.beam mod_offline.beam mod_vcard_odbc.beam xmerl.beam xmerl_xpath_scan.beam<br /> cyrsasl_plain.beam ejabberd_http.beam ejabberd_tmp_sup.beam jlib.beam mod_offline_odbc.beam mod_version.beam xmerl_eventp.beam xmerl_xs.beam<br /> ejabberd_admin.beam ejabberd_http_poll.beam ejabberd_update.beam mod_adhoc.beam mod_privacy.beam mod_xmlrpc.beam xmerl_html.beam xml.beam<br /> ejabberd.app ejabberd_listener.beam ejabberd_web_admin.beam mod_announce.beam mod_private.beam odbc_queries.beam xmerl_lib.beam xmlrpc.beam<br /> ejabberd_app.beam ejabberd_local.beam ejabberd_web.beam mod_configure2.beam mod_pubsub.beam randoms.beam xmerl_otpsgml.beam xmlrpc_decode.beam<br /> ejabberd_auth_anonymous.beam ejabberd_logger_h.beam ejabberd_zlib.beam mod_configure.beam mod_register.beam sha.beam xmerl_scan.beam xmlrpc_encode.beam<br /> ejabberd_auth.beam ejabberd_odbc.beam ejd2odbc.beam mod_disco.beam mod_roster.beam shaper.beam xmerl_sgml.beam xmlrpc_http.beam<br /> ejabberd_auth_external.beam ejabberd_odbc_sup.beam eldap.beam mod_echo.beam mod_roster_odbc.beam ssmtp.beam xmerl_simple.beam xmlrpc_util.beam<br /> ejabberd_auth_internal.beam ejabberd_receiver.beam eldap_filter.beam mod_irc.beam mod_service_log.beam stringprep.beam xmerl_text.beam xml_stream.beam<br /> ejabberd_auth_ldap.beam ejabberd_router.beam ELDAPv3.beam mod_irc_connection.beam mod_shared_roster.beam stringprep_sup.beam xmerl_validate.beam XmppAddr.beam</p> <p>When I start ejabberd: no errors with mod_xmlrpc</p> <p>Listener started on port 4560</p> <p>But when I try to execute xmlrpc:call({127, 0, 0, 1}, 4560, "/", {call, echothis, [800]}). I get {error, closed}</p> <p>Any help will be greatly appreciated.</p> <p>Thanks/Prasad</p> Mon, 03 Dec 2007 19:34:36 +0000 Prasad Panchangam comment 51403 at https://www.ejabberd.im I don't think so ! https://www.ejabberd.im/mod_xmlrpc#comment-48887 <p>From my limited tests (getting multhis and echothis to work correctly with a Ruby client) Xmerl 0.20 is not required anymore with Erlang 5.5/OTP R11B (I have ejabberd built from source so one may have to check for the binary installer).</p> <p>I guess you can safely remove the Xmerl 0.20 dependency from the documentation.</p> <p><noindex><a href="http://www.cestari.info" title="http://www.cestari.info" rel="nofollow" >http://www.cestari.info</a></noindex></p> Wed, 22 Aug 2007 12:26:24 +0000 cstar comment 48887 at https://www.ejabberd.im Is Xmerl 0.20 still required nowadays? https://www.ejabberd.im/mod_xmlrpc#comment-48886 <div class="quote-msg"> <div class="quote-author"><em>cstar</em> wrote:</div> <p>I figured so. I had xmlrpc working with xmerl 1.1.4 without issues</p></div> <p>Is Xmerl 1.1.4 the version included in recent Erlang/OTP releases? If so, do you mean that it's not required to install this Xmerl 0.20 library for mod_xmlrpc to work correctly?</p> Wed, 22 Aug 2007 08:32:00 +0000 mfoss comment 48886 at https://www.ejabberd.im Followup https://www.ejabberd.im/mod_xmlrpc#comment-48885 <div class="quote-msg"> <div class="quote-author"><em>badlop</em> wrote:</div> <p>Thanks for your reports. I've updated the copy of Erlang xmlrpc library that is hosted here, with your two small patches, and I call it xmlrpc-1.13-ipr.tgz. The added r is for Ruby :) </p></div> <p>great ! BTW the ruby client behavior has apparently changed from Ruby 1.8.2 and Ruby 1.8.4 (which added the charset=utf-8 thingy in the header)</p> <div class="quote-msg"> <div class="quote-author"><em>badlop</em> wrote:</div> <p>Well, maybe the Erlang library does not send UTF-8 characters, as Ruby expects. If that's the problem, maybe you find some useful hints somewhere in ejabberd or Yaws source code.</p></div> <p>I figured so. I had xmlrpc working with xmerl 1.1.4 without issues, and this version contains a very interesting xmerl_ucs module which should help.</p> Wed, 22 Aug 2007 08:25:11 +0000 cstar comment 48885 at https://www.ejabberd.im