You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Don Brady <db...@pobox.com> on 2003/07/12 21:26:32 UTC

Suppress Null Fields in Result SOAP?

Hi,

I am using doc/lit with Axis 1.1 to provide web services (for non-Java 
clients).

I would like to suppress the inclusion of null/ empty result fields.

For example,  right now I get back a SOAP result like the one shown below.

I would like to suppress the ones that are null, so as not to take so much 
bandwidth sending back empty data.

Is that possible?   I am using <all>  </all>  in the schema.  All of the 
fields are defines as strings in the schema.   I am setting the 
corresponding Java objects to null, but they still seem to be included.

Thanks!
=========================================

<soapenv:Envelope>
<soapenv:Body>

<AgentInformationResultElement>

<screenDate>07/12/2003</screenDate>
<screenTime></screenTime>
<topStatusLine/>
<bottomErrorLine/>
<agentNumber>923</agentNumber>
<agentCounty/>
<agentAgency/>
<agentOffice/>
<agentUnit/>
<agentLastName/>
<agentSuffix/>
<agentFirstName/>
<agentMiddleName/>
<agentNickname/>
<agentAddressIsBusiness/>
<agentAddressIsHome/>
<agentAddressPD/>
<agentAddressLine1/>
<agentAddressLine2/>
<agentSSNpart1/>
<agentSSNpart2/>
<agentSSNpart3/>

</AgentInformationResultElement>

</soapenv:Body>
</soapenv:Envelope>