Hi,

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 {
 xmlWriter.writeStartElement(namespace,"ignoreConflict");
                       }

                    } else {
                       xmlWriter.writeStartElement("ignoreConflict");
                    }
 
                    if (false) {
 
writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
                    } else {
 
xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIgnoreConflict));
                    }
 
                    xmlWriter.writeEndElement();


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

Julie





-- 
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.
-- 





Reply via email to