You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Kim Tran <ta...@hotmail.com> on 2003/03/26 12:16:16 UTC

How to send my Java object

Hi,
I have a Java class defined as follows;
class A {
  private ArrayList a;
  private ArrayList b;

  A(InputStream is) {}
  ....
  }
}

How can I send the above class object via SOAP?  Can I use the 
BeanSerializer? OR do I have to write my own ASerializer and ADeserializer?

* I tried to write my own serializer and deserializer, but I'm not quite 
sure what XSD type corresponding to ArrayList in my ADeSer.java (following 
DataDeser.java), for example,
       typesByMemberName.put(A_MEMBER, Constants.???what should i put 
here???);
       typesByMemberName.put(COLUMN_DESC_MEMBER, ???What should I put 
here????);

* I also tried to use BeanSerializer, but it gave me the following error 
when attempting to invoke the call and pass A object:

java.lang.IllegalAccessException
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.apache.axis.utils.BeanPropertyDescriptor.get(BeanPropertyDescript
or.java:144)
        at 
org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.
java:203)
        at 
org.apache.axis.encoding.SerializationContextImpl.serializeActual(Ser
ializationContextImpl.java:1228)
        at 
org.apache.axis.encoding.SerializationContextImpl.serialize(Serializa
tionContextImpl.java:775)
        at 
org.apache.axis.encoding.SerializationContextImpl.outputMultiRefs(Ser
ializationContextImpl.java:846)
        at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:155)

Many thanks in advance.

Kim.



_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


Re: How to send my Java object

Posted by Hans Russo resowe <Ha...@resowe.de>.
I think you could only use the BeanSerializerFactory if your class A
is the owner of a Standardconstructor and all attributes are private
and there is existing a set and get method for each attribute.

Hans

----- Original Message -----
From: "Kim Tran" <ta...@hotmail.com>
To: <ax...@ws.apache.org>
Sent: Wednesday, March 26, 2003 12:16 PM
Subject: How to send my Java object


> Hi,
> I have a Java class defined as follows;
> class A {
>   private ArrayList a;
>   private ArrayList b;
>
>   A(InputStream is) {}
>   ....
>   }
> }
>
> How can I send the above class object via SOAP?  Can I use the
> BeanSerializer? OR do I have to write my own ASerializer and
ADeserializer?
>
> * I tried to write my own serializer and deserializer, but I'm not quite
> sure what XSD type corresponding to ArrayList in my ADeSer.java (following
> DataDeser.java), for example,
>        typesByMemberName.put(A_MEMBER, Constants.???what should i put
> here???);
>        typesByMemberName.put(COLUMN_DESC_MEMBER, ???What should I put
> here????);
>
> * I also tried to use BeanSerializer, but it gave me the following error
> when attempting to invoke the call and pass A object:
>
> java.lang.IllegalAccessException
>         at java.lang.reflect.Method.invoke(Native Method)
>         at
> org.apache.axis.utils.BeanPropertyDescriptor.get(BeanPropertyDescript
> or.java:144)
>         at
> org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.
> java:203)
>         at
> org.apache.axis.encoding.SerializationContextImpl.serializeActual(Ser
> ializationContextImpl.java:1228)
>         at
> org.apache.axis.encoding.SerializationContextImpl.serialize(Serializa
> tionContextImpl.java:775)
>         at
> org.apache.axis.encoding.SerializationContextImpl.outputMultiRefs(Ser
> ializationContextImpl.java:846)
>         at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:155)
>
> Many thanks in advance.
>
> Kim.
>
>
>
> _________________________________________________________________
> The new MSN 8: smart spam protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>