0 Replies Latest reply on Apr 8, 2009 10:10 AM by roberto roberto

    Another issue with JBOSS WS and inheritance

    roberto roberto Novice

      Hi

      I have an issue using a 3 level java bean as argument of a web service operation.

      public class A
      {
       protected String iA;
       public String getA()
       {
       return iA;
       }
       public void setA(String aA)
       {
       iA = aA;
       }
      }
      
      public class B extends A
      {
       protected String iB;
       protected String getB()
       {
       return iB;
       }
       protected void setB(String aB)
       {
       iB = aB;
       }
      }
      
      public class C extends B
      {
       protected String iC;
       public String getC()
       {
       return iC;
       }
       public void setC(String aC)
       {
       iC = aC;
       }
      }
      


      Warning: Class "B" contains protected Field and Method!

      I publish a web service (based on a stateless EJB 2.1 session bean) that recieve an object of class "C".

      Deploy works fine. I can see the WSDL published and I can parse it from a client.

      Now, I'm writing a java client using a Dynamic Invocation Interface Model.

      I'm using it to avoid to create proxy classes.... and I don't want to use a wsdl2java tool.

      My client create a new instance of "C" and pass it as a parameter of my ws.

      But when the client serialize/prepare the SOAP message, it build a wrong message: "A" field is present 2 times!!
      I discover that the client (using all jboss jars) work by reflection in order to build the soap message.. but it seems to get 2 times the "A" field (maybe the first time from the class "B" and after from the class "A".

      In this way when the server recieve that message, of couse an exception is throws

      I believe this is a bug into dynamic javabean serialization model..
      I remove 1 level.. and now all works fine... but maybe in the furure I will need again to use another level.

      I'm using JBOSS 5.0.1 GA and also upgrade the JBoss WS to 3.1.0 GA (I try it because maybe this issue was just fixed) and Sun JDK 1.5.0_17-b04

      I read on previous post a lot of issue related to inheritance . Maybe this is a new one.

      Thanks
      Roberto