You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Phillpotts, James" <Ja...@experian.com> on 2011/07/20 17:32:33 UTC

Aegis Mappings file with Parameterized Class

Hi all,

I'm using JAX-WS in CXF 2.4.1 with Aegis for the type mapping. I've got
a parameterized class I'm using in my service roughly equivalent to the
following:

public interface BeanOne<T extends BeanTwo> extends Serializable {
	String getName();
	void setName(String name);
	List<T> getValues();
	void setValues(List<T> values);
}

I've then got a mapping file as follows:

<mappings>
	<mapping>
		<property name="values" minOccurs="1" nillable="false"
typeName="BeanTwos"
			componentType="com.acme.model.BeanTwo" />
		<property name="name" minOccurs="1" nillable="false" />
		<component class="com.acme.model.BeanTwo"
nillable="false" minOccurs="1"/>
	</mapping>
</mappings>

However, the WSDL comes out as follows:

<xsd:complexType name="BeanOne">
  <xsd:sequence>
    <xsd:element minOccurs="0" name="values" nillable="true"
type="ns1:BeanTwos"/>
    <xsd:element minOccurs="0" name="name" nillable="true"
type="xsd:string"/>
  </xsd:sequence>
</xsd:complexType>
..
<xsd:complexType name="BeanTwos">
  <xsd:sequence>
    <xsd:element maxOccurs="unbounded" name="BeanTwo" nillable="true"
type="ns0:BeanTwo"/>
  </xsd:sequence>
</xsd:complexType> 

You can see that the mapping file is being correctly used to rename the
ArrayOfBeanTwo to BeanTwos. However, the minOccurs and nillable
attributes are being ignored completely. I have scattered breakpoints
around XMLTypeCreator, trying to work out what happens, but it is quite
difficult to follow. 

I can see the AegisType being created in the createDefaultType method,
which ignores the mappings file at that time because the class is
parameterized (there's a comment saying We are not prepared to find
aegis.xml files for Parameterized types in findMapping method). 

But I can then see the TypeClassInfo being created for each of the two
properties in the class in createClassInfo(PropertyDescriptor), which
then correctly has the minOccurs and nillable being set. However this
information is obviously transitive in some way, as it doesn't end up in
the WSDL.

This seems to me to be a bug, unless anyone can spot something obvious I
should be doing?

Thanks,
James Phillpotts





Information in this e-mail and any attachments is confidential, and may not be copied or used by anyone other than the addressee, nor disclosed to any third party without our permission. There is no intention to create any legally binding contract or other binding commitment through the use of this electronic communication unless it is issued in accordance with the Experian Limited standard terms and conditions of purchase or other express written agreement between Experian Limited and the recipient. Although Experian has taken reasonable steps to ensure that this communication and any attachments are free from computer virus, you are advised to take your own steps to ensure that they are actually virus free. 

Companies Act information: Registered name: Experian Limited. Registered office: Landmark House, Experian Way, NG2 Business Park, Nottingham, NG80 1ZZ, United Kingdom. Place of registration: England and Wales. Registered number: 653331