Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 4185 invoked from network); 23 Jun 2008 03:18:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Jun 2008 03:18:42 -0000 Received: (qmail 75564 invoked by uid 500); 23 Jun 2008 03:18:35 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 75528 invoked by uid 500); 23 Jun 2008 03:18:35 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 75517 invoked by uid 99); 23 Jun 2008 03:18:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jun 2008 20:18:35 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [203.13.90.248] (HELO bnepms03.mincom.oz.au) (203.13.90.248) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jun 2008 03:17:45 +0000 Received: from bnedom05.mincom.oz.au (unverified [172.17.65.154]) by bnepms03.mincom.oz.au (Clearswift SMTPRS 5.2.3) with ESMTP id for ; Mon, 23 Jun 2008 13:23:35 +1000 To: axis-user@ws.apache.org Subject: Problem with setting boolean to nil MIME-Version: 1.0 X-Mailer: Lotus Notes Release 7.0.1 January 17, 2006 Message-ID: Date: Mon, 23 Jun 2008 13:18:04 +1000 From: Julie.Hansen@mincom.com X-MIMETrack: Serialize by Router on BNEDOM05/AU/Mincom(Release 7.0.2FP2 HF144|July 27, 2007) at 23/06/2008 01:18:06 PM, Serialize complete at 23/06/2008 01:18:06 PM Content-Type: multipart/alternative; boundary="=_alternative 001220B14A257471_=" X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 001220B14A257471_= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 : 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. -- --=_alternative 001220B14A257471_= Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit

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.

--

 

 

 

 

 

--=_alternative 001220B14A257471_=--