xmlrpcval with array and struct
Brought to you by:
ggiunta
Hi,
when i create a simple xmlrpcval, everything is fine but when i try to create a "complex" xmlrpcval,
I get this error message :
Notice: Undefined offset: 0 in /var/www/classic/xmlrpc.inc on line 3017
Fatal error: Call to a member function serialize() on a non-object in /var/www/classic/xmlrpc.inc on line 3017
Actually i get this when i try to add an array element. when i replace may array element by a struct it works.
i read your documentation, but i don't know where i'm wrong.
you can see a part of my code in the attached file.
Thank you for your help
Jeff
Anonymous
I think the problem comes from the fact that, to build an xmlrpc array value, the library expects to get a php array that is not a hash, but is indexed starting from 0.
In your code, you should change the "subscribers" structure to something like this:
Either that, or you should patch the xmlrpcval::serializedata function, to use a foreach() loop instead of a for() one, around line 3017...
I see... I will try it.
Thanks a lot.