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 "Armbrust, Daniel C." <Ar...@mayo.edu> on 2004/04/21 19:12:12 UTC

Axis doesn't properly handle private Boolean variables?

I have a java object that looks like this:

public class ITSOntologyConcept implements Serializable
{
    private String displayName_;
    private String value_;
    private Boolean isLeaf_;
    private String ontology_;
    
    public ITSOntologyConcept()
    {
        displayName_ = "";
        value_ = "";
        isLeaf_ = new Boolean(false);
    }
    
    public ITSOntologyConcept(String displayName, String value, Boolean isLeaf, String ontology)
    {
        displayName_ = displayName;
        value_ = value;
        isLeaf_ = isLeaf;
        ontology_ = ontology;
    }

// here it contains getters and setters for all of the private variables
}

This object is a return type for many of my service functions.

When I build my WSDL via the JAVA2WSDL tool, it completely ignores the isLeaf attribute!  The WSDL comes out looking like this:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn://mir.edu/ITSRuntime" xmlns:impl="urn://mir.edu/ITSRuntime" xmlns:intf="urn://mir.edu/ITSRuntime" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns2="http://exceptions.its.mir.mayo.edu" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
 <wsdl:types>
  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn://mir.edu/ITSRuntime">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="ArrayOf_xsd_string">
    <complexContent>
     <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
     </restriction>
    </complexContent>
   </complexType>
   <complexType name="ITSOntologyConcept">
    <sequence>
     <element name="displayName" nillable="true" type="xsd:string"/>
     <element name="ontology" nillable="true" type="xsd:string"/>
     <element name="value" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
   <complexType name="ArrayOfITSOntologyConcept">
    <complexContent>
     <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType" wsdl:arrayType="impl:ITSOntologyConcept[]"/>
     </restriction>
    </complexContent>
   </complexType>
  </schema>
  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://exceptions.its.mir.mayo.edu">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="ITSException">
    <sequence/>
   </complexType>
  </schema>
 </wsdl:types>
.......

If I change it to a public variable, instead of a private variable, then it picks it up.  However, then my service fails, because the java stubs generated from this wsdl are boolean instead of Boolean.

This is all with 1.1 final - I also tested with the current 1.2 beta, and got the same results.

Am I missing something really dumb, or can axis really not handle Boolean objects?

Thanks, 

Dan