axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bram>
Subject [Axis2] ArrayIndexOutOfBounds driving me crazy
Date Sat, 25 Feb 2006 18:28:38 GMT
Hi all,

I'm having a problem with an Axis2 webservice and it's driving me nuts for all 
day now, please help me out.
Basically, it comes down to this:

My webservice returns an array of categories to my client program and when no 
categories are found, a zero-sized array is returned to indicate this. 
However, when I try to return an empty-sized array, an ArrayIndexOutOfBound 
error is thrown.
Here's the relevant WSDL scheme:

<complexType name="Category">
		<element name="id" type="xsd:int"/>
		<element name="parent" type="xsd:int"/>
		<element name="title" type="xsd:string"/>

<complexType name="CategoryArray">
		<element name="category" minOccurs="0" maxOccurs="unbounded" 

The Java-code calls the autogenerated (WSDL2java) toEnvelope method:

org.apache.axis2.databinding.ADBSOAPModelBuilder builder = new 

return builder.getEnvelope();

When I debug this (autogenerated) piece of code with a breakpoint on the 
return statement, the debugger says

"com.sun.jdi.InvocationException occurred invoking method"

when inspecting the "body" member of the "builder" variable, so I guess the 
problem must be around that position somewhere.

I hope this is enough information. Please help me out with this one, I'm 
debugging for all damn day now and you're my last resort.


View raw message