[xwt-users] Passing arrays in xmlrpc calls

Tom Bogaert <[email protected]>
Newsgroups gmane.comp.java.xwt.users
Message-ID <[email protected]>
Hello,

Is it possible to pass arrays in xmlrpc calls from within xwt ?

I have a small xwar sample that I run locally against an xmlrpc server.
It successfully invokes a procedure that echoes back some string. Then
It calls a procedure to compute the sum of an array of doubles
But this seems to fail. The xwt logfile shows the following message
during the 2nd call:

"XMLRPC:  at main.1:33
              XMLRPC: attempt to send object of type java.lang.Object
via XML-RPC"

I test the xwar locally with the latest stable xwt engine (0281)
I get the same results for Windows and Linux.
For xmlrpc server I use the "HelloServer" demo program from 
the xmlrpcpp project - See http://xmlrpcpp.sourceforge.net.
(Below you find the main xwt routine+output from the xwar)

Thanks for any feedback

Tom
--------------------------------------------------------------------------
The sample code
--------------------------------------------------------------------------
<xwt>
    <static>
        xwt.theme("xwt.standard", "org.xwt.themes.monopoly");
        //xwt.theme("xwt.standard", "org.xwt.themes.aqua");
    </static>

    <redirect target="self"/>
    <import name="xwt.standard.*"/>
    <preapply name="frame"/>

    <template width="600" height="400" orient="vertical"
titlebar="XMLRPC-TEST">
        <box align="left" height="30" width="300" text="test xmlrpcpp's
HelloServer" font="dialog20"/>
        <button height = "30" width="400" align="topleft" text="test"
font="dialog20b">
           _Click1= function() 
                    {
                       $output.text="connecting ...";
                       xwt.thread = function()
                       {
                         try
                         {
                            $output.text=$output.text + "\n" + "Invoking
HelloName(\"world\")..." + "\n" ;
                           
result=xwt.xmlrpc("http://127.0.0.1:8001").HelloName("world");
                            $output.text=$output.text + "\n\nRESULT = "
+ result ;

                            $output.text=$output.text + "\n\n" +
"Invoking Sum(some array)..." + "\n" ;
                            var a = {} ;
                            a[0]=1.0 ;
                            a[1]=1.0 ;
                            a[2]=1.0 ;
                            a[3]=1.0 ;

                            $output.text=$output.text +"\n\nRESULT = " ;
                           
result=xwt.xmlrpc("http://127.0.0.1:8001").Sum(a);
                            $output.text=$output.text + result ;
                         }
                         catch(error)
                         {
                           
$output.text=$output.text+"\n"+error.faultString;
                         }
                       }
                    }
        </button>
        <bevel depth="down" thickness="2">
           <edit id="output"  color="white" multiline="true"
font="dialog20"/>
         </bevel>
    </template>
</xwt>

----------------------------------------------------------------------
The sample output
----------------------------------------------------------------------
connecting ... 
Invoking HelloName("world")... 


RESULT = Hello, world 

Invoking Sum(some array)... 


RESULT = 
undefined


---------------------------------------------
This mail was sent through webmail.wanadoo.be
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.