This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have been trying to do this for a while now, and I have come to the conclusion that it may be impossible. To demonstate what I want to do I enclose a simple java file . I have deployed this with Axis 2 and I enclose the responce , it is obciously not wat I want.
The problem could be the object SampleElement is not mapped to Axis2.
Instead of you generating the skeleton, aar, wsdl... Try to use axis2 supplied tools like Java2WSDL or WSDL2Java to generate the serverside and stub code for you. This will helps you get the all the return and input types mapped properly.
You are correct you cannot return a pure, naked array - the array must always be "contained". In XML sequences are only permitted inside another complexType - you cannot have a "free-floating" sequence.
Depending on the databinding that you are using another layer of containment may also be required if you need to distinguish between an empty array and a null array.
Basically it is a good idea to create web service interfaces contract first - that way the web service contract isn't influenced by the choice of the service implementation language (in this case Java).