You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Mike Kopack <mk...@isx.com> on 2002/10/24 20:54:19 UTC

Got the object working as a bean, problem with custom version serializer though

Hey guys,

Thanks for the help last week with registering my complex class as a SOAP transferable object. I was able to do it using the BeanSerializer class. However, I was forced to change my complex class into a Bean to use it.

Now that I've demonstrated to myself that it can be sent as a Bean, I really need to get it back to it's original non-bean form. To do this I realize that I need to write a custom (de)serializer. I've looked at the ones in the AddressBook2 samples, but they use classes that have all their member fields as being public. How can I do it if the fields are all PRIVATE, and there aren't accessor/mutator methods for each of the fields?

Thanks!

--Mike

Re: Got the object working as a bean, problem with custom version serializer though

Posted by Scott Nichol <sn...@scottnichol.com>.
If there is private state in the class that you want to serialize, your
class itself would have to implement the Serializer interface (since
that would be the only way to get to the private state).  If there is
state that cannot be set publicly, you would similarly have to implement
the deserializer interface in the class.

Scott Nichol

----- Original Message -----
From: "Mike Kopack" <mk...@isx.com>
To: <so...@xml.apache.org>
Sent: Thursday, October 24, 2002 2:54 PM
Subject: Got the object working as a bean, problem with custom version
serializer though


Hey guys,

Thanks for the help last week with registering my complex class as a
SOAP transferable object. I was able to do it using the BeanSerializer
class. However, I was forced to change my complex class into a Bean to
use it.

Now that I've demonstrated to myself that it can be sent as a Bean, I
really need to get it back to it's original non-bean form. To do this I
realize that I need to write a custom (de)serializer. I've looked at the
ones in the AddressBook2 samples, but they use classes that have all
their member fields as being public. How can I do it if the fields are
all PRIVATE, and there aren't accessor/mutator methods for each of the
fields?

Thanks!

--Mike


Re: Got the object working as a bean, problem with custom version serializer though

Posted by Scott Nichol <sn...@scottnichol.com>.
If there is private state in the class that you want to serialize, your
class itself would have to implement the Serializer interface (since
that would be the only way to get to the private state).  If there is
state that cannot be set publicly, you would similarly have to implement
the deserializer interface in the class.

Scott Nichol

----- Original Message -----
From: "Mike Kopack" <mk...@isx.com>
To: <so...@xml.apache.org>
Sent: Thursday, October 24, 2002 2:54 PM
Subject: Got the object working as a bean, problem with custom version
serializer though


Hey guys,

Thanks for the help last week with registering my complex class as a
SOAP transferable object. I was able to do it using the BeanSerializer
class. However, I was forced to change my complex class into a Bean to
use it.

Now that I've demonstrated to myself that it can be sent as a Bean, I
really need to get it back to it's original non-bean form. To do this I
realize that I need to write a custom (de)serializer. I've looked at the
ones in the AddressBook2 samples, but they use classes that have all
their member fields as being public. How can I do it if the fields are
all PRIVATE, and there aren't accessor/mutator methods for each of the
fields?

Thanks!

--Mike


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>