|
|
|
Also required is the Java5 bits and pieces.
Adam, this looks ok, but it seems that some of the tests don't pass. Can you check them out? It seems like there are problems with nillability and Dates. (See the BeanTest)
Also, if you could write a test or two to test the new extensibility stuff that would be most appreciated. updated patches that include updates to default values that were causeing tests to break and also some new test cases to cover the additions i have made.
patch that just adds a Test case for Configuration in order to test the changing of default values for minOccurs, Nillable , ExtensibleAttributes and ExtensibleElements.
This patch (to the root of the xfire tree) fixes Nillable and makes it configurable. I have added nillable to BeanTypeInfo, just like MinOccurs. There are 2 new test cases called ConfiguationTest to test the defaults in both the XMLTypeCreator and the Java5TypeCreator. I also needed to make the default for configuration in AbstractTypeCreator not null to stop a bunch of tests breaking.
I integrated your patch and things work swell now. You rock!
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
These patches add the following functionality:
1) extensibleElements defaulted to true - <xsd:any minOccurs="0" maxOccurs="unbounded"/> added to complex types in WSDL so that client's built against one version of the WSDL will no longer break when invoking a newer version of the service which contains new properties that are returned as elements
Globally configured by setting defaultExtensibleElements property on DefaultTypeMappingRegistry.
Overridable in the mapping file by adding extensibleElements to mapping file (untested)
Overridable using Java5 Annotations with new attribute extensibleElements added to XmlType annotation.
2) extensibleAttributes defaulted to true - <xsd:anyAttribute/> added to complex types in WSDL so that client's built against one version of the WSDL will no longer break when invoking a newer version of the service which contains new properties that are returned as attributes
Globally configured by setting defaultExtensibleAttributes property on DefaultTypeMappingRegistry.
Overridable in the mapping file by adding extensibleAttributes to mapping file (untested)
Overridable using Java5 Annotations with new attribute extensibleAttributess added to XmlType annotation.
3) minOccurs="0" is now configurable, although it does still default to true.
Globally configured by setting defaultMinOccurs (int) property on DefaultTypeMappingRegistry.
Overridable in the mapping file by adding minOccurs to mapping file (untested)
Overridable using Java5 Annotations with new String attribute minOccurs added to XmlElement annotation.
4) Nillable is now also more configurable and it still defaults to true.
Globally configured by setting defaultNillable property on DefaultTypeMappingRegistry.
I had to add a new boolean property to Type.java called nullable which allowed me to split the nullability (basically if the java type is a primitive) from the nillability (whether or not the user wants nillable="true" in the xml).
So now if you want to override all the defaults, then you should configure your DefaultTypeMappingRegistry like this:
<bean id="typeMappingRegistry" class="org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry">
<property name="defaultExtensibleElements" value="false"/>
<property name="defaultExtensibleAttributes" value="false"/>
<property name="defaultNillable" value="false"/>
<property name="defaultMinOccurs" value="1"/>
</bean>
Hope it is satisfactory