[Vortex] xml-rpc-gen and code generation containing an array of structs

Vincent AE Scott aspl at gestic.ulat.es
Thu Mar 15 22:05:17 CET 2007


#if francis /* Mar 15, 10:08 */
> El mi=E9, 14-03-2007 a las 22:20 +0000, Vincent AE Scott escribi=F3:
> > Hi there,
> 
> Hi Vicent,
> 
> > i've been playing around with the Vortex library and been trying out the
> > auto code generation tool xml-rpc-gen, but i think i've hit a problem
> > with it.
> >=20
> > It would appear from the (****) debug i've put in that
> > method_call_get_param_value_as_struct() is being passed an array, when
> > its expecting a struct.
> 
> You are right, the xml-rpc-gen tool was producing source code for the
> server side component which was trying to marshall an array as an
> struct. I've updated the source code, and checked it against your
> example (I've reconstructed it using your IDL def and the source code
> snipet).
> 
> It is now commited into the svn [1], revision 2600.
> 
> Let us to know your progress Vicent!
#endif /* francis at aspl.es */

Hi there,

Yep, that worked fine, cheers for that.

I did have one minor problem though, In my client code from yesterday i
was testing if the array position made a difference of where i was
placing my structs.  So i had ended up with the following:

        EventToken      *ev_tok1 = NULL;
        EventToken      *ev_tok2 = NULL;
        EventTokenArray *ev_arr = NULL;

        ev_tok1 = ar_eventtoken_new( "TOKEN=1", "VALUE=1111111111" );
        ev_tok2 = ar_eventtoken_new( "TOKEN=2", "VALUE=2222222222" );
        ev_arr = ar_eventtokenarray_new( 2 );

        ar_eventtokenarray_set( ev_arr, 1, ev_tok1 );
        ar_eventtokenarray_set( ev_arr, 2, ev_tok2 );


When this was run against the server it failed.

When i changed that above code to:

        ar_eventtokenarray_set( ev_arr, 0, ev_tok1 );
        ar_eventtokenarray_set( ev_arr, 1, ev_tok2 );

It Worked fine.

I thought ( and i havent checked the code yet ) that be specifying
ar_eventtokenarray_new( 2 ), that it'd fail if i tried to:

a) place more than two elements in the array
b) went past the end of the array boundaries.

But the client code appears to have accepted the former without failing.
Should this be expected?


BTW, and on a totally different note, would you like some help tidying
up the english translations on the code/web site?  There's quite a lot
of room for improvement.
Should this be expected?


BTW, and on a totally different note, would you like some help tidying
up the english translations on the code/web site?  There's quite a lot
of room for improvement.
Should this be expected?


BTW, and on a totally different note, would you like some help tidying
up the english translations on the code/web site?  There's quite a lot
of room for improvement.

Cheers,
-vince

-- 
keys:  http://codex.net/gpg.asc 

 Difficile est tenere quae acceperis nisi exerceas. 
 -- Pliny the Younger




More information about the Vortex mailing list