[Laszlo-user] question about javarpc and dataset

Henry Minsky henry.minsky at gmail.com
Thu Jul 19 11:55:22 PDT 2007


Can you send a small example of what your code looks like ?

There is an example in the source distribution in
test/rpc/javarpc/serverenv.lzx, which accesses a server side call to system
environment info test.xmlrpc.SystemProp

<canvas debug="true" width="800" >

<!--    <debug x="370" width="400" height="300" /> -->

    <alert name="errormsg"/>

    <simplelayout spacing="10"/>

    <dataset name="envDset" />

    <list name="env" width="250" height="200">
        <textlistitem name="ti" datapath="envDset:/*"
text="$path{'name()'}">
            <method event="onselect">
                canvas.display.setText(datapath.xpathQuery('text()'))
            </method>
        </textlistitem>
    </list>

    <text name="display" selectable="true" width="350" multiline="true"
bgcolor="0xd0d0d0" />

    <security>
        <allow>
            <pattern>^org\.openlaszlo\.test\.xmlrpc\.SystemProp$</pattern>
        </allow>
    </security>

    <javarpc name="systemprop" scope="none"
             remoteclassname="org.openlaszlo.test.xmlrpc.SystemProp">

        <method event="onload">
            Debug.write('onload invoke');
            this.getProperties.invoke();
        </method>

        <method event="onerror" args="msg">
            errormsg.setAttribute('text', 'error: ' + msg)
            errormsg.open()
        </method>

        <remotecall name="getProperties" funcname="getProperties"
                    dataobject="$once{envDset}">
            <method event="ondata" args="d">
                Debug.write('data:', d);
            </method>
        </remotecall>

    </javarpc>



Java Code:

package org.openlaszlo.test.xmlrpc;

import org.apache.xmlrpc.*;
import java.util.*;

public class SystemProp
{
        public static Hashtable getProperties()
        {
                return System.getProperties();
        }

    public static void main(String argv[])
    {
        WebServer ws = new WebServer(8181);
        SystemProp se = new SystemProp();
        ws.addHandler("localservice", se);
        ws.start();
    }
}


On 7/19/07, Ruben Reusser <rr at headwire.com> wrote:
>
> hi
>
> I am new thew openlaszlo and figured I do a little test program using
> JavaRPC and the 4.0.2 release. I am trying to populate a dataset (list)
> from a value returned from my java class but seem to fail.
> I can call the java class and get a return value (String) that is an
> XML. However, I am not sure if that is the way I am supposed to do it or
> not. When I look at the dataset it's empty. Does anyone have an example
> program that does that?
> I checked the mailing list and the forum but I am unable to find a
> working example (I can find a couple of people asking the same question).
>
> Thanks
>
> Ruben
>



-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-user/attachments/20070719/8e6f2a1b/attachment.html


More information about the Laszlo-user mailing list