Sheptunov, Bogdan wrote:
A "filter all those properties" approach is to create a interface for each of those beans you would like to serialize, but just including getters and setters for those properties you really want to be serialized; then let your bean implement that interface (already does!) and alter all your web services to not use the bean class but the "filtered inteface". The main drawback (and innaceptable for me) is
I already tried that. Defined an interface, had a class (that has some other properties besides the one declared in the bean interface) implement it, put the interface name in WSDD file. Axis ended up putting all of the properties (not only the ones defined in WSDD) into the response object anyway. This looks like a bug to me. Shouldn't only the properties listed in the WSDL be serialized?
Ideas anyone?
Bogdan
Just if you have not noticed it, check out the thread called "exposing only parts of a Java Bean" posted recently in this mailing list, and read Simon Fell comments:
"There's a constructor for the BeanSerializer that takes 4 parameters, the last parameter is an array of BeanPropertyDescriptor you can use this constructor to make a beanSerialzier that only knows about a subset of the fields on the bean. Its pretty easy to write a new Serializer class that wraps the BeanSerializer and constructs it as needed, then delegates all subsequent calls to it. Once you've got that, you just need to update the type mappings to tell Axis to use your new serializer instead of the bean serializer.
Cheers Simon "...
Anyway I'll explore someday that ObjectOutput serializer idea.
Bye.
