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 "Dennis Sosnoski (JIRA)" <ji...@apache.org> on 2006/09/28 06:51:50 UTC
[jira] Created: (AXIS2-1254) ADB cannot handle null return value
from service method
ADB cannot handle null return value from service method
-------------------------------------------------------
Key: AXIS2-1254
URL: http://issues.apache.org/jira/browse/AXIS2-1254
Project: Apache Axis 2.0 (Axis2)
Issue Type: Bug
Components: databinding
Affects Versions: nightly
Environment: Linux, Java 1.5
Reporter: Dennis Sosnoski
When the response content is an optional element null should be a valid return value from the corresponding method. I tried this with the following WSDL/schema fragment:
<element name="getBookResponse">
<complexType>
<sequence>
<element name="book" minOccurs="0" type="tns:BookInformation"/>
</sequence>
</complexType>
</element>
<wsdl:message name="getBookResponse">
<wsdl:part element="wns:getBookResponse" name="parameters"/>
</wsdl:message>
The result was an error on the server side when the corresponding method returned null:
[java] Exception in thread "main" org.apache.axis2.AxisFault: java.lang.RuntimeException: book cannot be null!!
[java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:298)
[java] at com.sosnoski.ws.library.adb.LibraryAdbStub.getBook(LibraryAdbStub.java:340)
[java] at com.sosnoski.ws.library.adb.WebServiceClient.main(WebServiceClient.java:45)
...
A null return value should be accepted in this case, resulting in an empty wrapper element (<getBookResponse/>, in this case).
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS2-1254) ADB cannot handle null return value
from service method
Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/AXIS2-1254?page=comments#action_12439696 ]
Davanum Srinivas commented on AXIS2-1254:
-----------------------------------------
Anyone got a chance to look at this one?
> ADB cannot handle null return value from service method
> -------------------------------------------------------
>
> Key: AXIS2-1254
> URL: http://issues.apache.org/jira/browse/AXIS2-1254
> Project: Apache Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: databinding
> Affects Versions: nightly
> Environment: Linux, Java 1.5
> Reporter: Dennis Sosnoski
> Priority: Blocker
> Attachments: bug.zip
>
>
> When the response content is an optional element null should be a valid return value from the corresponding method. I tried this with the following WSDL/schema fragment:
>
> <element name="getBookResponse">
> <complexType>
> <sequence>
> <element name="book" minOccurs="0" type="tns:BookInformation"/>
> </sequence>
> </complexType>
> </element>
> <wsdl:message name="getBookResponse">
> <wsdl:part element="wns:getBookResponse" name="parameters"/>
> </wsdl:message>
> The result was an error on the server side when the corresponding method returned null:
> [java] Exception in thread "main" org.apache.axis2.AxisFault: java.lang.RuntimeException: book cannot be null!!
> [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:298)
> [java] at com.sosnoski.ws.library.adb.LibraryAdbStub.getBook(LibraryAdbStub.java:340)
> [java] at com.sosnoski.ws.library.adb.WebServiceClient.main(WebServiceClient.java:45)
> ...
> A null return value should be accepted in this case, resulting in an empty wrapper element (<getBookResponse/>, in this case).
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Updated: (AXIS2-1254) ADB cannot handle null return value
from service method
Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/AXIS2-1254?page=all ]
Amila Chinthaka Suriarachchi updated AXIS2-1254:
------------------------------------------------
Attachment: ADBBeanTemplate.xsl-patch-041006.txt
Add code to check the nillable='true' and the minOccurs='0' states. These chages are applied to getOMElement and the getPullParser methods of the ADB beans.
Logic is as follows,
if the variable to be serialized is not null it is serialized normally.
if the variable to be serialized is null
1. if the corresponding element is set to nillable='true' null element is appended.
2. if the corresponding elements' minOccurs = 0 then nothing is done.
3.if not it is set to nillable='true' and minOccurs is 0 then throw a RuntimeException. (since variable can not be null at this stage)
> ADB cannot handle null return value from service method
> -------------------------------------------------------
>
> Key: AXIS2-1254
> URL: http://issues.apache.org/jira/browse/AXIS2-1254
> Project: Apache Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: databinding
> Affects Versions: nightly
> Environment: Linux, Java 1.5
> Reporter: Dennis Sosnoski
> Priority: Blocker
> Attachments: ADBBeanTemplate.xsl-patch-041006.txt, bug.zip
>
>
> When the response content is an optional element null should be a valid return value from the corresponding method. I tried this with the following WSDL/schema fragment:
>
> <element name="getBookResponse">
> <complexType>
> <sequence>
> <element name="book" minOccurs="0" type="tns:BookInformation"/>
> </sequence>
> </complexType>
> </element>
> <wsdl:message name="getBookResponse">
> <wsdl:part element="wns:getBookResponse" name="parameters"/>
> </wsdl:message>
> The result was an error on the server side when the corresponding method returned null:
> [java] Exception in thread "main" org.apache.axis2.AxisFault: java.lang.RuntimeException: book cannot be null!!
> [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:298)
> [java] at com.sosnoski.ws.library.adb.LibraryAdbStub.getBook(LibraryAdbStub.java:340)
> [java] at com.sosnoski.ws.library.adb.WebServiceClient.main(WebServiceClient.java:45)
> ...
> A null return value should be accepted in this case, resulting in an empty wrapper element (<getBookResponse/>, in this case).
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Resolved: (AXIS2-1254) ADB cannot handle null return value
from service method
Posted by "Eran Chinthaka (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/AXIS2-1254?page=all ]
Eran Chinthaka resolved AXIS2-1254.
-----------------------------------
Fix Version/s: 1.1
Resolution: Fixed
Patch applied to r454632. Thanks Amila.
> ADB cannot handle null return value from service method
> -------------------------------------------------------
>
> Key: AXIS2-1254
> URL: http://issues.apache.org/jira/browse/AXIS2-1254
> Project: Apache Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: databinding
> Affects Versions: nightly
> Environment: Linux, Java 1.5
> Reporter: Dennis Sosnoski
> Assigned To: Eran Chinthaka
> Priority: Blocker
> Fix For: 1.1
>
> Attachments: ADBBeanTemplate.xsl-patch-041006.txt, ADBBeanTemplate.xsl-patch-041006.txt, ADBBeanTemplate.xsl-patch-091006.txt, bug.zip
>
>
> When the response content is an optional element null should be a valid return value from the corresponding method. I tried this with the following WSDL/schema fragment:
>
> <element name="getBookResponse">
> <complexType>
> <sequence>
> <element name="book" minOccurs="0" type="tns:BookInformation"/>
> </sequence>
> </complexType>
> </element>
> <wsdl:message name="getBookResponse">
> <wsdl:part element="wns:getBookResponse" name="parameters"/>
> </wsdl:message>
> The result was an error on the server side when the corresponding method returned null:
> [java] Exception in thread "main" org.apache.axis2.AxisFault: java.lang.RuntimeException: book cannot be null!!
> [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:298)
> [java] at com.sosnoski.ws.library.adb.LibraryAdbStub.getBook(LibraryAdbStub.java:340)
> [java] at com.sosnoski.ws.library.adb.WebServiceClient.main(WebServiceClient.java:45)
> ...
> A null return value should be accepted in this case, resulting in an empty wrapper element (<getBookResponse/>, in this case).
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Assigned: (AXIS2-1254) ADB cannot handle null return value
from service method
Posted by "Dennis Sosnoski (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/AXIS2-1254?page=all ]
Dennis Sosnoski reassigned AXIS2-1254:
--------------------------------------
Assignee: Eran Chinthaka (was: Dennis Sosnoski)
Assigning this back to you, Eran, since you're best qualified to evaluate and apply Amila's patch.
I think we're in agreement on how this should work, that either nillable='true' or minOccurs='0' should allow a null value to be passed or returned.
> ADB cannot handle null return value from service method
> -------------------------------------------------------
>
> Key: AXIS2-1254
> URL: http://issues.apache.org/jira/browse/AXIS2-1254
> Project: Apache Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: databinding
> Affects Versions: nightly
> Environment: Linux, Java 1.5
> Reporter: Dennis Sosnoski
> Assigned To: Eran Chinthaka
> Priority: Blocker
> Attachments: ADBBeanTemplate.xsl-patch-041006.txt, ADBBeanTemplate.xsl-patch-041006.txt, bug.zip
>
>
> When the response content is an optional element null should be a valid return value from the corresponding method. I tried this with the following WSDL/schema fragment:
>
> <element name="getBookResponse">
> <complexType>
> <sequence>
> <element name="book" minOccurs="0" type="tns:BookInformation"/>
> </sequence>
> </complexType>
> </element>
> <wsdl:message name="getBookResponse">
> <wsdl:part element="wns:getBookResponse" name="parameters"/>
> </wsdl:message>
> The result was an error on the server side when the corresponding method returned null:
> [java] Exception in thread "main" org.apache.axis2.AxisFault: java.lang.RuntimeException: book cannot be null!!
> [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:298)
> [java] at com.sosnoski.ws.library.adb.LibraryAdbStub.getBook(LibraryAdbStub.java:340)
> [java] at com.sosnoski.ws.library.adb.WebServiceClient.main(WebServiceClient.java:45)
> ...
> A null return value should be accepted in this case, resulting in an empty wrapper element (<getBookResponse/>, in this case).
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS2-1254) ADB cannot handle null return value
from service method
Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/AXIS2-1254?page=comments#action_12440884 ]
Amila Chinthaka Suriarachchi commented on AXIS2-1254:
-----------------------------------------------------
When creating my earlier patch I did not notice the tracker variable at the template. So although it works it has some redundant code.
In the new patch I have used the tracker variable to make it simplified. In addition to fixing this bug I have handle the nillable case in the serialization logic too.
It is bit ambiguous the real meaning of the tracker variable. As I understood it is used to keep whether we have to serialize the associated element or not. In other words if the tracker is not available (i.e. minOccurs is 1) or present and true, we have to serialize the variable. Otherwise ( i.e. tracker is present and false) we can ignore it, since min occurs is zero.
When serializing, if the variable is not null, we can serialize it without having any problem. If not (i.e if variable is null), if element is set to nillable then we write the null attribute, else throw and exception since this is an invalid state.
> ADB cannot handle null return value from service method
> -------------------------------------------------------
>
> Key: AXIS2-1254
> URL: http://issues.apache.org/jira/browse/AXIS2-1254
> Project: Apache Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: databinding
> Affects Versions: nightly
> Environment: Linux, Java 1.5
> Reporter: Dennis Sosnoski
> Assigned To: Eran Chinthaka
> Priority: Blocker
> Attachments: ADBBeanTemplate.xsl-patch-041006.txt, ADBBeanTemplate.xsl-patch-041006.txt, ADBBeanTemplate.xsl-patch-091006.txt, bug.zip
>
>
> When the response content is an optional element null should be a valid return value from the corresponding method. I tried this with the following WSDL/schema fragment:
>
> <element name="getBookResponse">
> <complexType>
> <sequence>
> <element name="book" minOccurs="0" type="tns:BookInformation"/>
> </sequence>
> </complexType>
> </element>
> <wsdl:message name="getBookResponse">
> <wsdl:part element="wns:getBookResponse" name="parameters"/>
> </wsdl:message>
> The result was an error on the server side when the corresponding method returned null:
> [java] Exception in thread "main" org.apache.axis2.AxisFault: java.lang.RuntimeException: book cannot be null!!
> [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:298)
> [java] at com.sosnoski.ws.library.adb.LibraryAdbStub.getBook(LibraryAdbStub.java:340)
> [java] at com.sosnoski.ws.library.adb.WebServiceClient.main(WebServiceClient.java:45)
> ...
> A null return value should be accepted in this case, resulting in an empty wrapper element (<getBookResponse/>, in this case).
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Assigned: (AXIS2-1254) ADB cannot handle null return value
from service method
Posted by "Eran Chinthaka (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/AXIS2-1254?page=all ]
Eran Chinthaka reassigned AXIS2-1254:
-------------------------------------
Assignee: Eran Chinthaka
> ADB cannot handle null return value from service method
> -------------------------------------------------------
>
> Key: AXIS2-1254
> URL: http://issues.apache.org/jira/browse/AXIS2-1254
> Project: Apache Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: databinding
> Affects Versions: nightly
> Environment: Linux, Java 1.5
> Reporter: Dennis Sosnoski
> Assigned To: Eran Chinthaka
> Priority: Blocker
> Attachments: ADBBeanTemplate.xsl-patch-041006.txt, bug.zip
>
>
> When the response content is an optional element null should be a valid return value from the corresponding method. I tried this with the following WSDL/schema fragment:
>
> <element name="getBookResponse">
> <complexType>
> <sequence>
> <element name="book" minOccurs="0" type="tns:BookInformation"/>
> </sequence>
> </complexType>
> </element>
> <wsdl:message name="getBookResponse">
> <wsdl:part element="wns:getBookResponse" name="parameters"/>
> </wsdl:message>
> The result was an error on the server side when the corresponding method returned null:
> [java] Exception in thread "main" org.apache.axis2.AxisFault: java.lang.RuntimeException: book cannot be null!!
> [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:298)
> [java] at com.sosnoski.ws.library.adb.LibraryAdbStub.getBook(LibraryAdbStub.java:340)
> [java] at com.sosnoski.ws.library.adb.WebServiceClient.main(WebServiceClient.java:45)
> ...
> A null return value should be accepted in this case, resulting in an empty wrapper element (<getBookResponse/>, in this case).
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Assigned: (AXIS2-1254) ADB cannot handle null return value
from service method
Posted by "Eran Chinthaka (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/AXIS2-1254?page=all ]
Eran Chinthaka reassigned AXIS2-1254:
-------------------------------------
Assignee: Dennis Sosnoski (was: Eran Chinthaka)
Sorry I got it assigned to myself, without noticing Dennis' patch
> ADB cannot handle null return value from service method
> -------------------------------------------------------
>
> Key: AXIS2-1254
> URL: http://issues.apache.org/jira/browse/AXIS2-1254
> Project: Apache Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: databinding
> Affects Versions: nightly
> Environment: Linux, Java 1.5
> Reporter: Dennis Sosnoski
> Assigned To: Dennis Sosnoski
> Priority: Blocker
> Attachments: ADBBeanTemplate.xsl-patch-041006.txt, bug.zip
>
>
> When the response content is an optional element null should be a valid return value from the corresponding method. I tried this with the following WSDL/schema fragment:
>
> <element name="getBookResponse">
> <complexType>
> <sequence>
> <element name="book" minOccurs="0" type="tns:BookInformation"/>
> </sequence>
> </complexType>
> </element>
> <wsdl:message name="getBookResponse">
> <wsdl:part element="wns:getBookResponse" name="parameters"/>
> </wsdl:message>
> The result was an error on the server side when the corresponding method returned null:
> [java] Exception in thread "main" org.apache.axis2.AxisFault: java.lang.RuntimeException: book cannot be null!!
> [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:298)
> [java] at com.sosnoski.ws.library.adb.LibraryAdbStub.getBook(LibraryAdbStub.java:340)
> [java] at com.sosnoski.ws.library.adb.WebServiceClient.main(WebServiceClient.java:45)
> ...
> A null return value should be accepted in this case, resulting in an empty wrapper element (<getBookResponse/>, in this case).
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS2-1254) ADB cannot handle null return value
from service method
Posted by "Eran Chinthaka (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/AXIS2-1254?page=comments#action_12439822 ]
Eran Chinthaka commented on AXIS2-1254:
---------------------------------------
Ok, I was working with this issue today and just saw this patch.
Anyway, the reason to the initial problem referred to in this issue was, ADB was not not allowing to set null, even if minOccurs=0. I fixed by checking the nullity, when you call the set method (didn't commit the changes as I had more local changes which failed the build).
With that in mind, I don't think I can agree with you on the third point you have mentioned above. IIUC, you must have the ability not to mention anything about nilable but to set minOccurs=0. But you suggest to throw an exception in that case.
One could argue about the meaning or the interpretation of "null" in java w.r.t. nillable attribute and maxOccurs=0. IMO, if something is nillable then if the value is not set, you should see xsi:nill.
But
1. if there is nothing mentioned about nillable
2. maxOccurs=0
3. User calls setXX(null),
then the serialization should simply ignore that element.
Let me take an example :
If the schema of the element Book is
<element name="Book">
<complexType>
<sequence>
<element name="name" type="xsd:string" minOccurs="0"/>
<element name="author" type="xsd:string" minOccurs="0"/>
</sequence>
</complexType>
</element>
then if user calls
Book myBook = new Book();
myBook.setName("Handling Nulls");
myBook.setAuthor(null);
then the serialization would be
<Book>
<Name>Handling Nulls</Name>
</Book>
But if the schema was
<element name="Book">
<complexType>
<sequence>
<element name="name" type="xsd:string" minOccurs="0"/>
<element name="author" type="xsd:string" nillable="true"/>
</sequence>
</complexType>
</element>
Then the serialization will be
<Book>
<Name>Handling Nulls</Name>
<author xsi:nil="true" />
</Book>
Dennis, please correct me if I am wrong.
> ADB cannot handle null return value from service method
> -------------------------------------------------------
>
> Key: AXIS2-1254
> URL: http://issues.apache.org/jira/browse/AXIS2-1254
> Project: Apache Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: databinding
> Affects Versions: nightly
> Environment: Linux, Java 1.5
> Reporter: Dennis Sosnoski
> Assigned To: Eran Chinthaka
> Priority: Blocker
> Attachments: ADBBeanTemplate.xsl-patch-041006.txt, bug.zip
>
>
> When the response content is an optional element null should be a valid return value from the corresponding method. I tried this with the following WSDL/schema fragment:
>
> <element name="getBookResponse">
> <complexType>
> <sequence>
> <element name="book" minOccurs="0" type="tns:BookInformation"/>
> </sequence>
> </complexType>
> </element>
> <wsdl:message name="getBookResponse">
> <wsdl:part element="wns:getBookResponse" name="parameters"/>
> </wsdl:message>
> The result was an error on the server side when the corresponding method returned null:
> [java] Exception in thread "main" org.apache.axis2.AxisFault: java.lang.RuntimeException: book cannot be null!!
> [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:298)
> [java] at com.sosnoski.ws.library.adb.LibraryAdbStub.getBook(LibraryAdbStub.java:340)
> [java] at com.sosnoski.ws.library.adb.WebServiceClient.main(WebServiceClient.java:45)
> ...
> A null return value should be accepted in this case, resulting in an empty wrapper element (<getBookResponse/>, in this case).
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Updated: (AXIS2-1254) ADB cannot handle null return value
from service method
Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/AXIS2-1254?page=all ]
Amila Chinthaka Suriarachchi updated AXIS2-1254:
------------------------------------------------
Attachment: ADBBeanTemplate.xsl-patch-041006.txt
please use this patch. earlier one contains a few mistakes
> ADB cannot handle null return value from service method
> -------------------------------------------------------
>
> Key: AXIS2-1254
> URL: http://issues.apache.org/jira/browse/AXIS2-1254
> Project: Apache Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: databinding
> Affects Versions: nightly
> Environment: Linux, Java 1.5
> Reporter: Dennis Sosnoski
> Assigned To: Dennis Sosnoski
> Priority: Blocker
> Attachments: ADBBeanTemplate.xsl-patch-041006.txt, ADBBeanTemplate.xsl-patch-041006.txt, bug.zip
>
>
> When the response content is an optional element null should be a valid return value from the corresponding method. I tried this with the following WSDL/schema fragment:
>
> <element name="getBookResponse">
> <complexType>
> <sequence>
> <element name="book" minOccurs="0" type="tns:BookInformation"/>
> </sequence>
> </complexType>
> </element>
> <wsdl:message name="getBookResponse">
> <wsdl:part element="wns:getBookResponse" name="parameters"/>
> </wsdl:message>
> The result was an error on the server side when the corresponding method returned null:
> [java] Exception in thread "main" org.apache.axis2.AxisFault: java.lang.RuntimeException: book cannot be null!!
> [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:298)
> [java] at com.sosnoski.ws.library.adb.LibraryAdbStub.getBook(LibraryAdbStub.java:340)
> [java] at com.sosnoski.ws.library.adb.WebServiceClient.main(WebServiceClient.java:45)
> ...
> A null return value should be accepted in this case, resulting in an empty wrapper element (<getBookResponse/>, in this case).
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Updated: (AXIS2-1254) ADB cannot handle null return value
from service method
Posted by "Dennis Sosnoski (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/AXIS2-1254?page=all ]
Dennis Sosnoski updated AXIS2-1254:
-----------------------------------
Attachment: bug.zip
The zip contains a full Ant build. To use it, change the build.properties line to the appropriate Axis2 installation directory on your system.
> ADB cannot handle null return value from service method
> -------------------------------------------------------
>
> Key: AXIS2-1254
> URL: http://issues.apache.org/jira/browse/AXIS2-1254
> Project: Apache Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: databinding
> Affects Versions: nightly
> Environment: Linux, Java 1.5
> Reporter: Dennis Sosnoski
> Attachments: bug.zip
>
>
> When the response content is an optional element null should be a valid return value from the corresponding method. I tried this with the following WSDL/schema fragment:
>
> <element name="getBookResponse">
> <complexType>
> <sequence>
> <element name="book" minOccurs="0" type="tns:BookInformation"/>
> </sequence>
> </complexType>
> </element>
> <wsdl:message name="getBookResponse">
> <wsdl:part element="wns:getBookResponse" name="parameters"/>
> </wsdl:message>
> The result was an error on the server side when the corresponding method returned null:
> [java] Exception in thread "main" org.apache.axis2.AxisFault: java.lang.RuntimeException: book cannot be null!!
> [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:298)
> [java] at com.sosnoski.ws.library.adb.LibraryAdbStub.getBook(LibraryAdbStub.java:340)
> [java] at com.sosnoski.ws.library.adb.WebServiceClient.main(WebServiceClient.java:45)
> ...
> A null return value should be accepted in this case, resulting in an empty wrapper element (<getBookResponse/>, in this case).
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Updated: (AXIS2-1254) ADB cannot handle null return value
from service method
Posted by "Anonymous (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/AXIS2-1254?page=all ]
Attachment: ADBBeanTemplate.xsl-patch-091006.txt
> ADB cannot handle null return value from service method
> -------------------------------------------------------
>
> Key: AXIS2-1254
> URL: http://issues.apache.org/jira/browse/AXIS2-1254
> Project: Apache Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: databinding
> Affects Versions: nightly
> Environment: Linux, Java 1.5
> Reporter: Dennis Sosnoski
> Assigned To: Eran Chinthaka
> Priority: Blocker
> Attachments: ADBBeanTemplate.xsl-patch-041006.txt, ADBBeanTemplate.xsl-patch-041006.txt, ADBBeanTemplate.xsl-patch-091006.txt, bug.zip
>
>
> When the response content is an optional element null should be a valid return value from the corresponding method. I tried this with the following WSDL/schema fragment:
>
> <element name="getBookResponse">
> <complexType>
> <sequence>
> <element name="book" minOccurs="0" type="tns:BookInformation"/>
> </sequence>
> </complexType>
> </element>
> <wsdl:message name="getBookResponse">
> <wsdl:part element="wns:getBookResponse" name="parameters"/>
> </wsdl:message>
> The result was an error on the server side when the corresponding method returned null:
> [java] Exception in thread "main" org.apache.axis2.AxisFault: java.lang.RuntimeException: book cannot be null!!
> [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:298)
> [java] at com.sosnoski.ws.library.adb.LibraryAdbStub.getBook(LibraryAdbStub.java:340)
> [java] at com.sosnoski.ws.library.adb.WebServiceClient.main(WebServiceClient.java:45)
> ...
> A null return value should be accepted in this case, resulting in an empty wrapper element (<getBookResponse/>, in this case).
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Updated: (AXIS2-1254) ADB cannot handle null return value
from service method
Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/AXIS2-1254?page=all ]
Davanum Srinivas updated AXIS2-1254:
------------------------------------
Priority: Blocker (was: Major)
> ADB cannot handle null return value from service method
> -------------------------------------------------------
>
> Key: AXIS2-1254
> URL: http://issues.apache.org/jira/browse/AXIS2-1254
> Project: Apache Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: databinding
> Affects Versions: nightly
> Environment: Linux, Java 1.5
> Reporter: Dennis Sosnoski
> Priority: Blocker
> Attachments: bug.zip
>
>
> When the response content is an optional element null should be a valid return value from the corresponding method. I tried this with the following WSDL/schema fragment:
>
> <element name="getBookResponse">
> <complexType>
> <sequence>
> <element name="book" minOccurs="0" type="tns:BookInformation"/>
> </sequence>
> </complexType>
> </element>
> <wsdl:message name="getBookResponse">
> <wsdl:part element="wns:getBookResponse" name="parameters"/>
> </wsdl:message>
> The result was an error on the server side when the corresponding method returned null:
> [java] Exception in thread "main" org.apache.axis2.AxisFault: java.lang.RuntimeException: book cannot be null!!
> [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:298)
> [java] at com.sosnoski.ws.library.adb.LibraryAdbStub.getBook(LibraryAdbStub.java:340)
> [java] at com.sosnoski.ws.library.adb.WebServiceClient.main(WebServiceClient.java:45)
> ...
> A null return value should be accepted in this case, resulting in an empty wrapper element (<getBookResponse/>, in this case).
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS2-1254) ADB cannot handle null return value
from service method
Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/AXIS2-1254?page=comments#action_12439830 ]
Amila Chinthaka Suriarachchi commented on AXIS2-1254:
-----------------------------------------------------
You are correct chinthaka.
the third point should be
if not it is set to nillable='true' and minOccurs is not 0 then throw a RuntimeException. (since variable can not be null at this stage)
Which means basically in the element either,
it is not set to nillble( i.e. nillable='true') or
it is minOccurs is not 0 (i.e. minOccurs > 0) then obviously this element can not be null.
So we throw an exception.
Sorry for the mistake.
> ADB cannot handle null return value from service method
> -------------------------------------------------------
>
> Key: AXIS2-1254
> URL: http://issues.apache.org/jira/browse/AXIS2-1254
> Project: Apache Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: databinding
> Affects Versions: nightly
> Environment: Linux, Java 1.5
> Reporter: Dennis Sosnoski
> Assigned To: Dennis Sosnoski
> Priority: Blocker
> Attachments: ADBBeanTemplate.xsl-patch-041006.txt, ADBBeanTemplate.xsl-patch-041006.txt, bug.zip
>
>
> When the response content is an optional element null should be a valid return value from the corresponding method. I tried this with the following WSDL/schema fragment:
>
> <element name="getBookResponse">
> <complexType>
> <sequence>
> <element name="book" minOccurs="0" type="tns:BookInformation"/>
> </sequence>
> </complexType>
> </element>
> <wsdl:message name="getBookResponse">
> <wsdl:part element="wns:getBookResponse" name="parameters"/>
> </wsdl:message>
> The result was an error on the server side when the corresponding method returned null:
> [java] Exception in thread "main" org.apache.axis2.AxisFault: java.lang.RuntimeException: book cannot be null!!
> [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:298)
> [java] at com.sosnoski.ws.library.adb.LibraryAdbStub.getBook(LibraryAdbStub.java:340)
> [java] at com.sosnoski.ws.library.adb.WebServiceClient.main(WebServiceClient.java:45)
> ...
> A null return value should be accepted in this case, resulting in an empty wrapper element (<getBookResponse/>, in this case).
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org