I don't think Java2WSDL takes account of serializers, but I could be wrong. One of the methods of the Serializer interface is a writeSchema method. This gets called when WSDL is automatically generated when the "?wsdl" suffix is used in the URL to a service. It knows to do this because of type mappings defined in the WSDD file. I don't know how Java2WSDL can be made aware of custom serialization, though.
Why do you need to generate WSDL many times a day? Surely the interface should be nailed down and changed infrequently. Did you think about the wrapper class approach?
I agree, it would be nice if the generator took account of BeanInfo.
Tony
Tim Gmane wrote on 25/11/2004 19:22:42:
>
> After reading the JavaBeans spec again, you are right a bean property
> can be read-only in which case only the get() method needs to appear or
> it can be write-only in which case only the set() method needs to
> appear, so Axis is doing the right thing exposing these properties that
> don't have both get/set methods.
>
> Anyway, assuming that I can get a custom serializer to do what I want,
> will it solve the Java2WSDL problem? Will the tool use my custom
> serializers to determine what properties to expose or will it still
> expose all bean properties and I would have to edit the WSDL by hand
> which is not an option because I am generating it many times a day and
> it's pretty long and complicated.
>
> It would be too nice for Axis to support BeanInfo :)
>
> Thanks for your help.
>
> Tim
>
>
> [EMAIL PROTECTED] wrote:
> >
> > The only other "simple" thing I can think of is, instead of using an
> > interface, as you've tried, use a wrapper class. If the service returns
> > the wrapper object, that only exposes the attributes you want, but wraps
> > the real object, then Axis will only serialize the properties you want
> > serialized. If the wrapper was a subclass of the original class and
> > delegated to the original object, then it wouldn't be too difficult, no
> > WSDL changes needed and no need for the wrapper class on the other side.
> >
> > Or you could write your own serializer (using the BeanDeserializer for
> > deserializing). It's a bit tedious but it might be worth the exercise.
> >
> > Tony
> >
> >
> > Tim wrote on 24/11/2004 16:23:56:
> >
> > > <tony.q.weddle <at> gsk.com> writes:
> > >
> > > >
> > > >
> > > > Just a couple of point on this.
> > > > The JavaBean specification does not requite
> > > > a getter and setter for each property. A get method implies a readable
> > > > property (in Axis terms, it means that property can be serialised).
> > A set
> > > > method implies a modifiable property (in Axis terms, it means the
> > property
> > > > can be deserialised).
> > > > Simon mentioned a special constructor on BeanSerializer
> > > > and BeanDeserializer. If this can be used to do what Tim wants, only
> > > BeanSerializerFactory
> > > > and BeanDeserializerFactory subclasses would be needed, to create the
> > > appropriate
> > > > instance, and specified in the mapping. However, a quick scan of the
> > > BeanDeserializer
> > > > indicates that it might not do the job - sorry, if I've got that wrong.
> > > > Tony
> > > >
> > >
> > > And I assume Axis does not care about a BeanInfo, does it?
> > >
> > > So is there a way to achieve what I need short of renaming the getXXX
> > and
> > > setYYY methods to something else which in some cases is not even
> > possible
> > > (e.g. I have a CusomException which overrides the
> > Throwable.getMessage(), now
> > > I end up with a getMessage1() method and a "message1" element in the
> > complex
> > > type in the WSDL which I do not want or need, and renaming the method
> > > getMessage() in my CustomException is not an option in this case).
> > >
> > > I think Axis really needs a descriptor of some sort that let's the
> > user pick
> > > and choose what's being exposed.
> > >
> > > Thank you,
> > >
> > > Tim
>
>
- exposing only parts of a Java Bean Tim Dev
- Re: exposing only parts of a Java Bean James Black
- Re: exposing only parts of a Java Bean Tim Dev
- RE: exposing only parts of a Java Bean Simon Fell
- Re: exposing only parts of a Java Bean Tim
- Re: exposing only parts of a Java Bean tony . q . weddle
- Re: exposing only parts of a Java Bean Tim
- Re: exposing only parts of a Java ... tony . q . weddle
- Re: exposing only parts of a J... Tim Gmane
- Re: exposing only parts of... tony . q . weddle
- Re: exposing only parts of... tony . q . weddle
- Re: exposing only parts of... Tim K. (Gmane)
- RE: exposing only parts of a Java Bean Simon Fell