axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eugene Shershnev (JIRA)" <>
Subject [jira] Commented: (AXIS-530) elements without minOccurs="0" produce isnill="true" on the wire
Date Wed, 16 Mar 2005 21:43:23 GMT
     [ ]
Eugene Shershnev commented on AXIS-530:

I just tested this in the nightly build of 2005/03/16.

Here is what I have:

1) Wrapped web service, Tomcat 5.5.4

2) WSDL:

<complexType name="ComplexType">
    <element name="int0" nillable="true"  minOccurs="0" type="xsd:int"/>
    <element name="int1" nillable="false" minOccurs="0" type="xsd:int"/>
    <element name="int2" nillable="true"  minOccurs="1" type="xsd:int"/>
    <element name="int3" nillable="false" minOccurs="1" type="xsd:int"/>

3) ComplexType class definition:

public class ComplexType implements {
    private Integer int0;
    private Integer int1;
    private Integer int2;
    private Integer int3;

    public ComplexType() {
        int0 = null;
        int1 = null;
        int2 = null;
        int3 = null;

    // setters and getters ...

and service method returning this ComplexType:

public ComplexType complexTypeOut() {
  return new ComplexType();

Here is a SOAP response I get:

  <complexTypeOutResponse xmlns="http://test.enterprise.ent">
      <int0 xsi:nil="true"/>
      <int1 xsi:nil="true"/>
      <int2 xsi:nil="true"/>
      <int3 xsi:nil="true"/>

and here is what I expect to see on the wire instead:

  <complexTypeOutResponse xmlns="http://test.enterprise.ent">
      <int2 xsi:nil="true"/>

The above is an ideal case - int0 may or may not be present if int0 is null.
But int1 must not be present if int1 is null, int2 must be present in any case, and int3 must
be present and must not be null - if it is null an exception should be thrown by Axis.

> elements without minOccurs="0" produce isnill="true" on the wire
> ----------------------------------------------------------------
>          Key: AXIS-530
>          URL:
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.0
>  Environment: Operating System: Other
> Platform: Other
>     Reporter: Andre Kramer
>     Assignee: Glen Daniels
>      Fix For: 1.2
>  Attachments: patch.tar.gz
> Elements that are marked optional in wsdl schema. e.g. profile field in:
> <complexType name="User">
>   <sequence>
>     <element name="profile" type="someComplexType" minOccurs="0"/>
>   </sequence>
> </complexType>
> <element name="User" type="types:User"/>
> Produces (inside SOAP body element) on the wire:
> <User>
>    <profile xsi:nil="true"/>
> </User>
> Since the profile schema element is not marked as nillable="true" (only 
> minOccurs="0") it would (at least) save bandwidth to just drop it altogether:
> <User>
> </User>
> [Both formats already work for deserialization.]
> thanks,
> Andre

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
If you want more information on JIRA, or have a bug to report see:

View raw message