struct of array of structs
"manuel_fdez_cmpos" <[email protected]> Wed, 27 Sep 2006 17:53:36 -0000
| Newsgroups | gmane.text.xml.rpc.specification |
|---|---|
| Message-ID | <[email protected]> |
Hello.
I need a complex structure to my project. I define this structure in
C++ server that it use the xmlrpc++ lib. In the server i try to make
a structure that contain this "struct of array of a struct".
Well, the code that does this is:
result["Energia"] = cds->getEnergiaTotal();
result["Iteraccion"] = cds->getIteraccion();
lista = cds->getNodos();
nodo = lista->getNodoInicial();
i=0;
do
{
result["nodos"][i]["x"] = nodo->getX();
result["nodos"][i]["y"] = nodo->getY();
nodo = nodo->sig;
i++;
}while(nodo != lista->getNodoInicial());
the struct have three terms or elements. The two firts are a
String-double pair. The third term is a
String-array-struct(String-int).
With the key "nodos" i obtain the array where each element is a structure.
The Xml response is this:
<value>
<struct>
<member>
<name>Energia</name>
<value><double>359928.450000</double></value>
</member>
<member>
<name>Iteraccion</name>
<value><i4>109</i4></value>
</member>
<member>
<name>nodos</name>
<value>
<array>
<data>
<value>
<struct>
<member>
<name>x</name>
<value><i4>134</i4></value>
</member>
<member>
<name>y</name>
<value><i4>128</i4></value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>x</name>
<value><i4>128</i4></value>
</member>
<member>
<name>y</name>
<value><i4>126</i4></value>
</member>
</struct>
</value>
</data>
</array>
</value>
</member>
</struct>
</value>
I think that this is correct.
this work perfectly with a C++ client but I need that the client will
be in Java.
the problem that I have is that the Array it recognizes as an object
and I cannot work with him.
How do i define this structure? where is the error?
Best regards,
M
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/xml-rpc/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/xml-rpc/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[email protected]
mailto:[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/