axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yves <li...@langisch.ch>
Subject Re: serialize only certain fields of bean
Date Mon, 02 Aug 2004 15:44:58 GMT
it's written without c -> transient

Arnaud Vezain wrote:

>What about transcient property.
>In a classic serializable object, writing "transcient" before any field
>name allows to hide it to the serialization process.
>
>
>-----Original Message-----
>From: "Maurice Marrink" <maurice.marrink@topicus.nl>
>To: <axis-user@ws.apache.org>
>Date: Mon, 2 Aug 2004 16:43:05 +0200
>Subject: serialize only certain fields of bean
>
>  
>
>>Hi,
>>
>>I have a number of beans I want to serialize to a soap message. I use
>>the
>>standard beanserializer that comes with axis 1.1 and that works great,
>>but
>>now I have several fields in different beans that I don't want to
>>serialize.
>>Example : Class A {
>>	private String a;
>>	private String b;
>>	private String c;
>>	private String d;
>>	//getters and setters
>>}
>>In the output soap message I only want so see the values for a and c. I
>>came
>>across this thread on this mailinglist that suggested to use
>><myClass>BeanInfo classes, and that worked great. Untill I found out
>>those
>>classes interfered with the rest of the application. So I had to get
>>ridd of
>>them. I also tried to use the <myClass>_Helper classes to specify a
>>custom
>>TypeDesc, trying to fake those fields I did not need as attributes.
>>Which
>>also doesn't work because those fields still get serialized only as
>>attribute instead of elements. minOccurs=0 in the TypeDesc also won't
>>work
>>because then the fields would have to be null, which they are not.
>>
>>Is there another way to tell axis which fields to serialize or is my
>>only
>>hope to override beanserializer and do the serializing myself. The
>>solution
>>is preferably something axis specific because the rest of my
>>application is
>>using all the fields.
>>
>>Here is the relevant part of my wsdd
>><service name="UserService" provider="java:RPC" style="rpc"
>>use="encoded" >
>>	<parameter name="className"
>>value="nl.topicus.bao.web.webservices.UserService"/>
>>	<parameter name="allowedMethods" value="*"/>
>>	<parameter name="scope" value="application"/>
>>	<namespace>http://www.topicus.nl/parnassys</namespace>
>></service>
>>
>>Thx,
>>
>>Maurice Marrink
>>
>>
>>
>>
>>    
>>
>
>
>
>
>
>  
>


Mime
View raw message