cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "alistair (JIRA)" <>
Subject [jira] Created: (CXF-2699) MapType does not set value to nillable
Date Mon, 08 Mar 2010 15:14:27 GMT
MapType does not set value to nillable

                 Key: CXF-2699
             Project: CXF
          Issue Type: Bug
          Components: Aegis Databinding
    Affects Versions: 2.2.6
         Environment: windows xp, java 5
            Reporter: alistair
             Fix For: 2.2.7

The MapType class (in org.apache.cxf.aegis.type.collection) creates the schema element for
maps. It does not set nillable for the value in the entry.

It is legal to have 

HashMap<String, Object> myMap containing {myKey->null} and to return such a map from
a call to a web method. 

The following wsdl is generated : 

<xsd:element name="myMap" nillable="true" type="string2anyTypeMap" /> 

<xsd:complexType name="string2anyTypeMap"> 
<xsd:element maxOccurs="unbounded" minOccurs="0" name="entry"> 
<xsd:element minOccurs="0" name="key" type="xsd:string" /> 
<xsd:element minOccurs="0" name="value" type="xsd:anyType" /> 

On a query that retrieves myMap I can get 

                           <value ns6:nil="true" xmlns:ns6=""/>

which does not conform to the generated schema.

In type MapType createElement should probably be renamed to createKeyElement and a new createValueElement
method that sets nillable to the result of type.isNillable().

Current method:
     * Creates a element in a sequence for the key type and the value type.
    private void createElement(XmlSchemaSequence seq, QName name, Type type) {
        XmlSchemaElement element = new XmlSchemaElement();

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message