axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Marquard (JIRA)" <>
Subject [jira] Updated: (AXIS-2054) Axis sends xsi:nil for non-nillable, minOccurs=0 parameters
Date Tue, 14 Jun 2005 22:35:03 GMT
     [ ]

Dave Marquard updated AXIS-2054:

    Attachment: EchoService.wsdl

The full WSDL for the echo example mentioned above.

> Axis sends xsi:nil for non-nillable, minOccurs=0 parameters
> -----------------------------------------------------------
>          Key: AXIS-2054
>          URL:
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: current (nightly), 1.2
>     Reporter: Dave Marquard
>  Attachments: EchoService.wsdl, omit-parameter-patch.txt
> Axis always sends null parameters as XML elements with an xsi:nill="true" attribute,
even if the parameter is defined as non-nillable in the WSDL. For example, consider the method:
> String echo(String parameter)
> that is represented in a Wrapped Document/Literal WSDL file as:
> <element name="echo">
>   <complexType>
>     <sequence>
>       <element name="parameter" type="xsd:string" minOccurs="0" nillable="false"/>
>     </sequence>
>   </complexType>
> </element>
> when the service is invoked as echo(null), Axis sends the following SOAP body:
> <echo xmlns="http://DefaultNamespace">
>   <parameter xsi:nil="true"/>
> </echo>
> which is invalid according to the WSDL file.
> Looking at the source, it looks like the problem is in org.apache.axis.message.RPCParam.serialize(),
which always passes true for the "sendNull" parameter to SerializationContext.serialize(),
regardless of whether the parameter is nillable or not.
> I have attached a small patch that:
> 1. Adds an "omittable" attribute to the ParameterDesc metadata object, to indicate whether
a parameter has a minimum occurrence of 0 or not.
> 2. Changes RPCParam to inspect this property, and to indicate to SerizationContext to
not send null if a parameter is omittable.
> 3. Changes JavaStubWriter in WSDL2Java to generate calls to the new ParameterDesc.setOmittable()
method for parameters with a minimum occurrence of 0.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message