Currently, the ImmutableListAdapter is producing XML schema like the following (this example is from the GroupService):
In this case, anyTypeArray comes from the http://jaxb.dev.java.net/array schema and does not properly use the schema types from the elements of the "array". This is because this adapater is currently declared as follows:
This use of Object triggers the issue. Unfortunately, because of the nature of type erasure and the way that the JAXB adapter system works, there is no way to create a single, general-purpose adapter that targets the appropriate parameterized list type.
Possible options here include:
- Look at the possibility introducing a custom CXF interceptor which will translate appropriately, would need to define a custom marker annotation to identify which lists/collections need to be unmodifiable
- Add some functionality to the KSB so that it creates it's own client-side proxies that consider immutability on list return types, would still need a custom annotation as above
- Create an adapter class per immutable parameterized list type and annotate using that
Either way, the current usage of ImmutableListAdapter and ImmutableCollectionAdapter needs to be removed.