You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Steve Green <st...@epok.net> on 2004/07/27 23:54:47 UTC

Primitive types for use="optional"

Developers,

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

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.

~Steve