Hi all,

I have a C++ function that returns an array of objects, but gSOAP 
serialises this as an element with no xsi:type.  The receiving system 
thus doesn't realise it's an array and doesn't deserialise it properly.

Does anyone know how I can force gSOAP to supply xsi:type attributes on 
arrays?

This is my function:

int ns__search(struct soap *soap, t_searchcriteria sc,
   xsd__int maxResults,
   struct ns__searchResponse {
     struct ns__records {
       int __size;
       t_record *__ptrrecord;
     } records;
   } &result
);

And this is an excerpt of the XML code that gSOAP generates:

<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://...";>
   <ns:searchResponse>
     <records>
       <ns:record xsi:type="ns:person">
         ...
       </ns:record>
       <ns:record xsi:type="ns:person">
         ...
       </ns:record>
...

The xsi:type attributes are on the <ns:record/> elements because my 
custom serialiser puts them there, but I'm not sure how to get it on the 
<records> element.  (Or how to get the namespace on there for that matter.)

Any ideas?

Thanks,
Adam.

Reply via email to