You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Dave Marquard (JIRA)" <ax...@ws.apache.org> on 2005/06/15 00:23:47 UTC

[jira] Created: (AXIS-2054) Axis sends xsi:nil for non-nillable, minOccurs=0 parameters

Axis sends xsi:nil for non-nillable, minOccurs=0 parameters
-----------------------------------------------------------

         Key: AXIS-2054
         URL: http://issues.apache.org/jira/browse/AXIS-2054
     Project: Apache Axis
        Type: Bug
  Components: Serialization/Deserialization  
    Versions: current (nightly), 1.2    
    Reporter: Dave Marquard


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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (AXIS-2054) Axis sends xsi:nil for non-nillable, minOccurs=0 parameters

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2054?page=all ]
     
Davanum Srinivas resolved AXIS-2054:
------------------------------------

    Resolution: Fixed

Applied Patch. Sorry for the delay one of the interop servers was down.

> Axis sends xsi:nil for non-nillable, minOccurs=0 parameters
> -----------------------------------------------------------
>
>          Key: AXIS-2054
>          URL: http://issues.apache.org/jira/browse/AXIS-2054
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: current (nightly), 1.2
>     Reporter: Dave Marquard
>  Attachments: EchoService.wsdl, omit-parameter-patch-v2.txt, omit-parameter-patch.txt, omit-parameter-test.zip
>
> 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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXIS-2054) Axis sends xsi:nil for non-nillable, minOccurs=0 parameters

Posted by "Dave Marquard (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2054?page=all ]

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: http://issues.apache.org/jira/browse/AXIS-2054
>      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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXIS-2054) Axis sends xsi:nil for non-nillable, minOccurs=0 parameters

Posted by "Dave Marquard (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2054?page=all ]

Dave Marquard updated AXIS-2054:
--------------------------------

    Attachment: omit-parameter-test.zip

New test case for omit vs nillable parameter behavior. Adds a new test/wsdl/omitParameter/ test case.

> Axis sends xsi:nil for non-nillable, minOccurs=0 parameters
> -----------------------------------------------------------
>
>          Key: AXIS-2054
>          URL: http://issues.apache.org/jira/browse/AXIS-2054
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: current (nightly), 1.2
>     Reporter: Dave Marquard
>  Attachments: EchoService.wsdl, omit-parameter-patch-v2.txt, omit-parameter-patch.txt, omit-parameter-test.zip
>
> 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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-2054) Axis sends xsi:nil for non-nillable, minOccurs=0 parameters

Posted by "Anand Raghavendran (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2054?page=comments#action_12323249 ] 

Anand Raghavendran commented on AXIS-2054:
------------------------------------------

We are facing the very same issue with Axis 1.2.1 release.  This problem does not go away for us even when using the 1.3 nightly build.  Please let us know what switched we have to set in WSDL2JAVA command line to toggle off the  generation of xsi:nil=true.

Our schema has:

<element name="parameter" type="xsd:string" minOccurs="0" /> declaration

Anand

> Axis sends xsi:nil for non-nillable, minOccurs=0 parameters
> -----------------------------------------------------------
>
>          Key: AXIS-2054
>          URL: http://issues.apache.org/jira/browse/AXIS-2054
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: current (nightly), 1.2
>     Reporter: Dave Marquard
>  Attachments: EchoService.wsdl, omit-parameter-patch-v2.txt, omit-parameter-patch.txt, omit-parameter-test.zip
>
> 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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXIS-2054) Axis sends xsi:nil for non-nillable, minOccurs=0 parameters

Posted by "Dave Marquard (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2054?page=all ]

Dave Marquard updated AXIS-2054:
--------------------------------

    Attachment: omit-parameter-patch.txt

Patch to fix sending xsi:nil="true" for parameters that are minOccurs="0" but nillable="false".

> Axis sends xsi:nil for non-nillable, minOccurs=0 parameters
> -----------------------------------------------------------
>
>          Key: AXIS-2054
>          URL: http://issues.apache.org/jira/browse/AXIS-2054
>      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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXIS-2054) Axis sends xsi:nil for non-nillable, minOccurs=0 parameters

Posted by "Dave Marquard (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2054?page=all ]

Dave Marquard updated AXIS-2054:
--------------------------------

    Attachment: omit-parameter-patch-v2.txt

Attaching v2 of the patch. This fixes the all-tests failures that Dims noted last week.

The new version of the patch does the following:
1. Change RPCParam to omit minOccurs="0", nillable="false" null parameters. RPCParam now uses nillable="true" for parameters that are both nillable and omittable to preserve legacy behavior.
2. Change ParameterDesc to add attributes for nillable and omittable.
3. Change JavaStubWriter in WSDL2Java to set the new ParameterDesc attributes as appropriate.
4. Add a new attribute for nillable to Parameter so that WSDL2Java can set that attribute when emitting Java stubs.
5. Change the test/wsdl/wrapped test case WSDL so that the array elements are nillable in the schema. Axis already was generating array elements with xsi:nil="true"; this fix just makes the schema agree with what Axis was already doing.

Finally, I have also attached a new test case to verify the omit vs. nillable behavior for parameters (test/wsdl/omitParameter).

> Axis sends xsi:nil for non-nillable, minOccurs=0 parameters
> -----------------------------------------------------------
>
>          Key: AXIS-2054
>          URL: http://issues.apache.org/jira/browse/AXIS-2054
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: current (nightly), 1.2
>     Reporter: Dave Marquard
>  Attachments: EchoService.wsdl, omit-parameter-patch-v2.txt, omit-parameter-patch.txt, omit-parameter-test.zip
>
> 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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-2054) Axis sends xsi:nil for non-nillable, minOccurs=0 parameters

Posted by "zhou guoku (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2054?page=comments#action_12369806 ] 

zhou guoku commented on AXIS-2054:
----------------------------------

I am also facing the same issue  whith Axis 1.2.1 Release.For avoid this problem,what can i do.
By the way, why there is not a Fix Verson.


> Axis sends xsi:nil for non-nillable, minOccurs=0 parameters
> -----------------------------------------------------------
>
>          Key: AXIS-2054
>          URL: http://issues.apache.org/jira/browse/AXIS-2054
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: current (nightly), 1.2
>     Reporter: Dave Marquard
>  Attachments: EchoService.wsdl, omit-parameter-patch-v2.txt, omit-parameter-patch.txt, omit-parameter-test.zip
>
> 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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira