Helma Logo
main list history

Version 7 by hannes on 17. February 2009, 20:14

Version 6 by hannes on 17. February 2009, 19:42

1=== Prerequisite
3This sample uses the Jala extension to Helma, so you have to use Helma 1.6.x or get Jala from *http://dev.orf.at/jala* at/jala*. You can add the Jala module by calling: app.addRepository('modules/jala/code/XmlRpcRequest.js').
5You must create two Helma applications: xmlrpcserver and xmlrcpclient. No special configuration of Helma is necessary.
7Special configuration of Helma is not necessary.=== Server
9
10==Server
11
25
33=== Client
35==Client
36
45=== Configuration
47==Configuration
48
50

Version 5 by anton on 08. August 2008, 11:36

3This sample uses the Jala extension to Helma, so you have to use Helma 1.6.x or get Jala from *http://dev.orf.at/jala*at/jala* You can add the Jala module by calling: app.addRepository('modules/jala/code/XmlRpcRequest.js'

Version 4 by anton on 08. August 2008, 11:33

25The first argument of the XML/RPC action is the method name. Arguments 1..n are the supplied arguments by the client. Note that you don't generate a response by writingwriting to the res object, but by simply returning a XML-RPCable return value from the action.
26to the res object, but by simply returning a XML-RPCable return value
27from the action.
46

Version 3 by anton on 08. August 2008, 11:33

25The first argument of the XML/RPC action is the method name. Arguments 1..n are the supplied arguments by the client. Note that you don't generate a response by writing
26to the res object, but by simply returning a XML-RPCable return value
27from the action.

Version 2 by anton on 08. August 2008, 11:31

5You must create two Helma applications: xmlrpcserver and xmlrcpclient.
7Special configuration of Helma is not necessary.
8
9
10helma/apps/xmlrcpserver/actions.js:
23The first argument of the XML/RPC action is the method name. Arguments 1..n are the supplied arguments by the client.
26helma/apps/xmlrpcserver/functions.js
31This is just how you could layout your XML/RPC actions.
36    var xmlReq = new jalahelma/apps/xmlrpcclient/actions.XmlRpcRequest("http://localhost:8080/xmlrpcserver/", "addDoc");js
37    var xmlRes = xmlReq.execute({name: "ist einfach gut"});function main_action()
38    res    var xmlReq = new jala.debug(xmlRes.result);XmlRpcRequest("http://localhost:8080/xmlrpcserver/", "addDoc");
39        var xmlRes = xmlReq.execute({name: "ist einfach gut"});
40        res.debug(xmlRes.result);
41    }
42
43In this example i am supplying a JSON-Object to be sent to the xmlrpcserver. You can send as many argument as you like. I would not send to complex datatypes. But integers, strings and JSON Objects are good.
44
45==Configuration
46
47You can change the XML/RPC Port in the Helma start script.
48This can be  start.bat or start.sh in your Helma home directory or if you use /etc/init.d/helma to start and stop your Helma instance you can change the configuration in /etc/helma.conf.

Version 1 by anton on 08. August 2008, 11:23

1==Prerequisite
3This sample uses the Jala extension to Helma, so you have to use Helma 1.6.x or get Jala from *http://dev.orf.at/jala*
4
5
6==Server
7
8    function main_action_xmlrpc(methodName, param) {
9        switch(methodName) {
10            case "addDoc":
11                return this[methodName](param);
12                break;
13            default:
14                return "method '" + methodName + "' not supported!";
15                break;
16        }
17        return ;
18    }
19
20
21
22    function addDoc(param) {
23        return "added '" + param.name + "' to the search index.";
24    }
25
26
27
28==Client
29
30    var xmlReq = new jala.XmlRpcRequest("http://localhost:8080/xmlrpcserver/", "addDoc");
31    var xmlRes = xmlReq.execute({name: "ist einfach gut"});
32    res.debug(xmlRes.result);