2 Replies Latest reply on Dec 9, 2005 2:19 PM by Thomas Diesler

    Generic (De-)Serialisation of Custom JavaBeans

    Lars Eulberg Newbie


      is it possible to write an endpoint with a method that can get and return "every" custom java bean?

      Something like:

      JavaBean getObject();
      void setObject(JavaBean bean);

      The reason for that is to write a generic proxy web service which passes records from a database between the database and the web client without any visible round trips. Until now, I only see the possibility to write serializers and deserializers for that. But I'm worry about that I have to develop a complete framework.

      Thanks for some hints


        • 1. Re: Generic (De-)Serialisation of Custom JavaBeans
          Bogdan Solomon Newbie

          Are you trying to send just one JavaBean without references to other objects or can it have complicated links? As much time as your object graph is acyclical you can send without customs serializers/deserializers. If you have cycles you need your own serializer/deserializers or the web service will give a stack overflow.

          Other then that if your bean has private fields and getters/setters for those fields there is no problem. Just make sure it uses MetaDataBeanSerializer and ....Deserializer in your ws4ee-deployment.xml. (I think it will use it by default).

          Hm I just though about it. Do you mean JavaBean is a superclass? If yes then your SEI needs to define all the JavaBeans subclasses that will be used and the example should work.

          • 2. Re: Generic (De-)Serialisation of Custom JavaBeans
            Thomas Diesler Master

            For a definite answer about JAXRPC supported types, have a look at


            JavaBeans are supported. Polimorphic JavaBeans are supported. Object graphs are not supported because they cannot be mapped to XML schema.