I am creating a client for a web service which uses the following WSDL fragment.

<complexType name="findAddress">
            <sequence>
               <element name="Address_1" type="ns2:Address" nillable="true"/>
               <element name="ArrayOfSearchOptionBase_2" 
type="ns2:ArrayOfSearchOptionBase" nillable="true"/>
               <element name="ArrayOfSortOption_3" type="ns2:ArrayOfSortOption" 
nillable="true"/>
               <element name="ArrayOfResultField_4" 
type="ns2:ArrayOfResultField" nillable="true"/>
               <element name="CallerContext_5" type="ns3:CallerContext" 
nillable="true"/>
            </sequence>
         </complexType>

If I create a findAddress struct and create only the Address_1 member gSOAP 
serializes the struct to XML with only the Address_1 element. The server 
rejects this XML as the other required elements (e.g. 
ArrayOfSearchOptionBase_2, etc.) are not present.

To get a correct message, I have to create the other members as well, although 
they do not contain any useful data (i.e. they will be empty elements in the 
XML). To me this seems a bit cumbersome.

Is it possible to let gSOAP automatically serialize an empty element, if the 
struct member is null and the element is nillable?


Reply via email to