6 Replies Latest reply on Nov 29, 2004 5:02 AM by Gayathiri R

    Returning Custom DataTypes in JBOSS4.0.0

    Gayathiri R Newbie

      Hi,
      I have successfully deploy the web service using jbossWS .

      But i have the following issue ,

      My method is returning the array of objects , for example it is
      having 32 records , but in the client side it returns the only one record .
      i am using the rpc/literal

      My method definition is , public org.ezyield.yieldjava.InventoryArray
      getYieldByWebsiteId(java.lang.String in0) throws java.rmi.RemoteException;

      public class InventoryArray implements java.io.Serializable
      {
      
       public org.ezyield.yieldjava.Inventory[] inventoryArray;
      
       public InventoryArray() {
       }
      
       public org.ezyield.yieldjava.Inventory[] getInventoryArray() {
       return inventoryArray;
       }
      
       public void setInventoryArray(org.ezyield.yieldjava.Inventory[] inventoryArray) {
       this.inventoryArray = inventoryArray;
       }
      }


      When i access the getInventoryArray method in the client side it returns the Only one Object (Inventory) but actually it has 32 objects (Iinventory objects )

      i have used Serializtion in ws4ee-deployment.xml file

      <typeMapping xmlns:ns="http://yieldjava.ezyield.org"
       qname="ns:InventoryArray"
       type="java:org.ezyield.yieldjava.InventoryArray"
       serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
       deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
       encodingStyle="">
       <typeDesc xmlType='ns:InventoryArray'>
       <elementDesc fieldName="inventoryArray" xmlName="inventoryArray" xmlType="ns:InventoryArray"/>
       </typeDesc>
       </typeMapping>
      
      <typeMapping xmlns:ns="http://yieldjava.ezyield.org"
       qname="ns:Inventory"
       type="java:org.ezyield.yieldjava.Inventory"
       serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
       deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
       encodingStyle=""
       />


      Thanks in Advance

      Regards
      Gayathiri

        • 1. Re: Returning Custom DataTypes in JBOSS4.0.0
          Thomas Diesler Master

          Gayathiri,

          your typeDesc will not be seen by the Axis BeanSerializer/Deserializer. Instead use

          serializer='org.jboss.webservice.encoding.ser.MetaDataBeanSerializerFactdeserializer='org.jboss.webservice.encoding.ser.MetaDataBeanDeserialize


          On the server side, set the debugging level of org.apache.axis to DEBUG, then you will see whether the server actually sends 32 array items in the response message or not.

          On the client side, you can do the same and examine how the deserializer instanciates your array items and populates the array.

          If you are convinced that this is a bug, please file an issue with SF and provide a simple sample deployment that allows me to reproduce what you are seeing.

          Thanks

          • 2. Re: Returning Custom DataTypes in JBOSS4.0.0
            Thomas Diesler Master

             

             serializer='org.jboss.webservice.encoding.ser.MetaDataBeanSerializerFactory'
             deserializer='org.jboss.webservice.encoding.ser.MetaDataBeanDeserializerFactory'
            


            • 3. Re: Returning Custom DataTypes in JBOSS4.0.0
              Gayathiri R Newbie

              Hi,
              I replaced serializer code with ur code
              and trying to run the client

              It throws this exception

              Exception in thread "main" java.lang.NoClassDefFoundError: org.jboss.webservice.encoding.ser.MetaDataBeanSerializerFactory
              at org.ezyield.yieldjava.InventoryEndpointSoapBindingStub.class$(InventoryEndpointSoapBindingStub.java:23)
              at org.ezyield.yieldjava.InventoryEndpointSoapBindingStub.(InventoryEndpointSoapBindingStub.java:62)
              at org.ezyield.yieldjava.InventoryEndpointSoapBindingStub.(InventoryEndpointSoapBindingStub.java:48)
              at org.ezyield.yieldjava.InventoryEndpointServiceLocator.getInventoryEndpoint(InventoryEndpointServiceLocator.java:43)
              at org.ezyield.yieldjava.InventoryClient.getBindingStub(InventoryClient.java:149)
              at org.ezyield.yieldjava.InventoryClient.main(InventoryClient.java:162)

              i have set the classpath to this file
              jboss-ws4ee.jar
              but still it throws this exception

              Rgds
              Gayathiri

              • 4. Re: Returning Custom DataTypes in JBOSS4.0.0
                Thomas Diesler Master

                You want jboss-ws4ee-client.jar on your client's CP, but jboss-ws4ee.jar should work as well. Enable trace level debugging for classloading to see what is going on - it must be something stupid.

                • 5. Re: Returning Custom DataTypes in JBOSS4.0.0
                  Thomas Diesler Master

                  Also have a look at the samples.zip provided on the wiki. It contains a complexbean sample which does array serialization of a custom bean.

                  • 6. Re: Returning Custom DataTypes in JBOSS4.0.0
                    Gayathiri R Newbie

                    Hi,
                    Thanks for ur help...solved the issue

                    Rgds
                    Gayathiri