Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.2
-
None
-
None
-
XP, Java 1.4.2_13, Tomcat 5.0.28
Description
A service returns an array of JavaBeans that is of length 0.
The client gets an exception "Unexpected subelement"
This may be related to bugs 2464 and 1702
To provide some clarity, I will attach a version of sample/addressbook. I've made the following changes:
(1) In the service, I've added methods to return arrays of Entry:
public Entry[] getEntries1() {
return new Entry[]
;
}
public Entry[] getEntries2()
{ return new Entry[0]; }(2) Then I exercise both methods in the client as follows (the call to getEntries2 fails):
GetEntries1Response e1Response = stub.getEntries1();
Entry[] entries1 = e1Response.get_return();
System.out.println("Number of items returned by getEntries1(): " + entries1.length);
GetEntries2Response e2Response = stub.getEntries2();
Entry[] entries2 = e2Response.get_return();
System.out.println("Number of items returned by getEntries2(): " + entries2.length);
I did it this way so that the fact that an array of length > 0 is obvious.
If I had time, I'd check with simple types, but in my case, a bean is the most important object type I need to return in an array.
Idea:
There seems to be a whole cluster of small issues around the POJO service + ADB client. E.g., methods that return void, exception handling, etc. A somewhat more robust version of sample/addressbook might bring these out. I'd be glad to beef up the example . . .
I think the POJO service + ADB client is key for the Axis2 "product" because if the simplest entry point is awkward, people will just bag it and use other impls of the various APIs.
Attachments
Attachments
Issue Links
- is related to
-
AXIS2-1702 WSDL2Java: minOccurs and maxOccurs in <sequence>/<choice> are not respected.
- Resolved
-
AXIS2-4319 CLONE -WSDL2Java: minOccurs and maxOccurs in <sequence>/<choice> are not respected.
- Resolved
-
AXIS2-2464 java.lang.RuntimeException: Unexpected subelement value
- Resolved