axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Problem with setting boolean to nil
Date Mon, 23 Jun 2008 03:18:04 GMT

I have found that the java code generated from a WSDL does not seem to 
support setting boolean fields to nil.

For example - here is a snippet of the WSDL :

  <element name="ignoreConflict" nillable="true" type="xsd:boolean" /> 

and the java code generated to add this element to the soap request is as 
follows :

                  namespace = "";
                  if (! namespace.equals("")) {
                      prefix = xmlWriter.getPrefix(namespace);
                      if (prefix == null) {
                         prefix = generatePrefix(namespace);

 xmlWriter.writeStartElement(prefix,"ignoreConflict", namespace);
                         xmlWriter.writeNamespace(prefix, namespace);
                         xmlWriter.setPrefix(prefix, namespace);

                       } else {

                    } else {
                    if (false) {
                    } else {

Note the 'if' statement which actually writes the data to the element - it 
will never write the 'nil' attribute.

I want to be able to indicate that the value of an element has not been 
set, rather than passing 'true' or 'false' as the boolean value.

Is this possible???

I have tried this with both Axis2 v 1.3 & 1.4.

Many Thanks


This transmission is for the intended addressee only and is confidential information. If you
have received this transmission in error, please notify the sender and delete the transmission.
The contents of this e-mail are the opinion of the writer only and are not endorsed by the
Mincom Group of companies unless expressly stated otherwise.

View raw message