History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XFIRE-295
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Dan Diephouse
Reporter: Adam J Chesney
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XFire

optionally add xs:any & xs:anyAttribute to complex types produced by Aegis WSDL builder

Created: 09/Mar/06 04:14 AM   Updated: 27/Mar/06 09:17 AM
Component/s: Aegis Module, Annotations
Affects Version/s: None
Fix Version/s: 1.1-beta-1

Time Tracking:
Not Specified

File Attachments: 1. Text File ConfigurationTest.patch (4 kb)
2. Text File JIRA295PlusAegisPatch-updated.patch (57 kb)
3. Text File JIRA295PlusAegisPatch.patch (52 kb)
4. Text File JIRA295PlusJava5Patch-updated.patch (14 kb)
5. Text File JIRA295PlusJava5Patch.patch (11 kb)
6. Text File NillableWorksWithNewTests.patch (12 kb)

Environment: all


 Description  « Hide
In order to future proof web service clients so that evolving schemas do not
break existing clients, I would like to add some functionality to the Aegis
WSDL building module.

The proposal is to optionally add:

<xs:any minOccurs="0" maxOccurs="unbounded"/>
and
<xs:anyAttribute/>

To complex types produced by the Aegis WSDL creation classes.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Adam J Chesney - 13/Mar/06 08:53 AM
Attached is 2 patches, one for the Aegis module and one for the Java5 module.

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


Adam J Chesney - 13/Mar/06 08:54 AM
Also required is the Java5 bits and pieces.

Dan Diephouse - 15/Mar/06 08:32 AM
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.


Adam J Chesney - 16/Mar/06 06:14 AM
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.

Adam J Chesney - 22/Mar/06 08:15 AM
patch that just adds a Test case for Configuration in order to test the changing of default values for minOccurs, Nillable , ExtensibleAttributes and ExtensibleElements.

Adam J Chesney - 23/Mar/06 04:33 AM
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.

Dan Diephouse - 27/Mar/06 09:17 AM
I integrated your patch and things work swell now. You rock!