Hi, Yes, I'm using ADB. I tried to change to sequence instead of all, but nothing changed. I'm implementing a workaround now by returning an 'empty'-element, but that's not good coding style IMHO. Didn't try with XMLBeans yet. Could you tell me what's the difference between the two?
Bram Op zondag 26 februari 2006 02:40, schreef Ajith Ranabahu: > Hi Bram, > Are you using ADB ? if so the <all/> schema construct can be an issue. > A recently done change to the deser code of ADB only supports > sequence. So here are two things you can try out! > 1. Change all to sequence. However the sequence requires the elements > to be properly ordered! > 2. Try using XMLBeans.(it should handle all these schema constructs > properly!). > > > Ajith > > On 2/25/06, Bram Biesbrouck <[EMAIL PROTECTED]> wrote: > > 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"> > > <all> > > <element name="id" type="xsd:int"/> > > <element name="parent" type="xsd:int"/> > > <element name="title" type="xsd:string"/> > > </all> > > </complexType> > > > > <complexType name="CategoryArray"> > > <sequence> > > <element name="category" minOccurs="0" > > maxOccurs="unbounded" type="myxsd:Category"/> > > </sequence> > > </complexType> > > > > The Java-code calls the autogenerated (WSDL2java) toEnvelope method: > > > > org.apache.axis2.databinding.ADBSOAPModelBuilder builder = new > > org.apache.axis2.databinding.ADBSOAPModelBuilder(param.getPullParser(com. > >bpower2.ws.instrudeo.xsd.AvailableCategoriesResponse.MY_QNAME), factory); > > 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. > > > > Bram > > -- > Ajith Ranabahu