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 "Koney, Satish" <Sa...@syntelinc.com> on 2004/12/08 04:50:19 UTC

Hiding setter methods of a bean

Hello,

I am writing a web service in which I am returning a User object to the
client. On the server side, this User object looks just like an ordinary
JavaBean.
In the server side I want to have setter methods for all the properties in
User.

But when I return the User object to the client, that object should not have
setter methods.
Is there anyway I can achieve this?

Thanks,
SSSS.



____________________________________________
Confidential:  This electronic message and all contents contain information
from Syntel, Inc. which may be privileged, confidential or otherwise
protected from disclosure. The information is intended to be for the
addressee only. If you are not the addressee, any disclosure, copy,
distribution or use of the contents of this message is prohibited.  If you
have received this electronic message in error, please notify the sender
immediately and destroy the original message and all copies.

Re: Hiding setter methods of a bean

Posted by "Brian J. Sayatovic" <tr...@trinition.org>.
I think a custom Serializer/Deserializer will handle this.  Then you can 
write out the schema with only those attributes you'd like, and then 
only write out / read in the properties you're interested in exposing 
when de/serializing instances.

Regards,
Brian.

Koney, Satish wrote:

>Hello,
>
>I am writing a web service in which I am returning a User object to the
>client. On the server side, this User object looks just like an ordinary
>JavaBean.
>In the server side I want to have setter methods for all the properties in
>User.
>
>But when I return the User object to the client, that object should not have
>setter methods.
>Is there anyway I can achieve this?
>
>Thanks,
>SSSS.
>
>
>
>____________________________________________
>Confidential:  This electronic message and all contents contain information
>from Syntel, Inc. which may be privileged, confidential or otherwise
>protected from disclosure. The information is intended to be for the
>addressee only. If you are not the addressee, any disclosure, copy,
>distribution or use of the contents of this message is prohibited.  If you
>have received this electronic message in error, please notify the sender
>immediately and destroy the original message and all copies.
>
>  
>