i had a similar problem and adding a no argument constructor seemed to fix it. it seems that the BeanSerializer is perhaps not very good at letting you know if your bean does not comply with the java beans spec.
-----Original Message-----
From: Shellman, Joel [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 25, 2002 4:27 PM
To: [EMAIL PROTECTED]
Subject: RE: BeanSerializer support array properties?
To answer my own question, yes, apparently it expects both getters and setters, so I've added the appropriate setters.
It's still not quite there, though because now it creates the type definition for the main object, but it's not creating type definitions for the contained classes.
For example:
public class MyComplexClass {
MyObject[] myObjects;
public MyObject[] getMyObjects() {
return this.myObjects;
}
public void setMyObjects(MyObject[] newMyObjects) {
this.myObjects = newMyObjects;
}
}
public class WS {
public MyComplexClass doSomething() {
...
}
}
So if I create a WSDL for the WS class, it generates a complexType element for the MyComplexClass, but it doesn't create one for MyObject. So it still won't work.
Is there something that will get it to autogenerate the WSDL right to include the contained class?
Thanks,
-joel
-----Original Message-----
From: Shellman, Joel
Sent: Thursday, July 25, 2002 1:31 PM
To: '[EMAIL PROTECTED]'
Subject: BeanSerializer support array properties?
Does the BeanSerializer support indexed properties?
So if I have:
MyObject[] myObjects;
MyObject[] getMyObjects() {
return this.myObjects;
}
inside my class, will the BeanSerializer automatically handle it? It doesn't
seem to (it ignores that field completely in both the WSDL generation and
serialization), so I'm trying to find out what I need to do to make it work.
I ran a test of:
Class javaType = MyObject.class;
TypeDesc typeDesc = TypeDesc.getTypeDescForClass(javaType);
BeanPropertyDescriptor[] pds = BeanUtils.getPd(javaType, typeDesc);
for (int i=0; i<pds.length; i++) {
System.out.println(pds[i].getName());
}
And noticed that these utilities (this is what BeanSerializer uses
internally to get the fields) don't return the myObjects field at all, so
apparently the problem is that either I'm not conforming to what BeanUtils
expects for the bean paradigm (which wouldn't surprise me--anyone know what
I need to do different?) or BeanUtils isn't working quite right.
Thanks,
Joel Shellman