axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Jordahl <>
Subject RE: Primitive types for use="optional"
Date Thu, 29 Jul 2004 22:44:26 GMT

I would certainly believe that the implementation of attributes does not
take in to account optional ones.

Having the attribute be a wrapper type in the Bean sounds like the right

I would add a getOptional() to ElementDecl and find the right place in
SymbolTable to set it....

Tom Jordahl
Macromedia Server Development

-----Original Message-----
From: Steve Green [] 
Sent: Tuesday, July 27, 2004 5:55 PM
Subject: Primitive types for use="optional"


I am wondering if WSDL2java is doing the right thing for optional
attributes/elements of primitive types.  In my particular use case, I
have an xsd:boolean attribute that is marked at optional.  WSDL2java
writes a primitive boolean accessor and thus within the context of the
bean, there is no way to determine the difference between false and "not

I found this line in class JavaBeanWriter.

		if (elem.getMinOccursIs0() || elem.getNillable()) {
			typeName = Utils.getWrapperType(typeName);

Is there any reason (per spec or by design or ...) that that line
shouldn't also include a check for optional?

ElementDecl doesn't have a getOptional() call, so I didn't go forth and
test this idea or investigate it further.

Thank you.


View raw message