2 Replies Latest reply on Dec 9, 2005 2:19 PM by thomas.diesler

    Generic (De-)Serialisation of Custom JavaBeans

    leulberg

      Hi,

      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

      Lars

        • 1. Re: Generic (De-)Serialisation of Custom JavaBeans
          bogsolomon

          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

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

            http://www.jcp.org/en/jsr/detail?id=101

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