axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yves <>
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" <>
>To: <>
>Date: Mon, 2 Aug 2004 16:43:05 +0200
>Subject: serialize only certain fields of bean
>>I have a number of beans I want to serialize to a soap message. I use
>>standard beanserializer that comes with axis 1.1 and that works great,
>>now I have several fields in different beans that I don't want to
>>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
>>across this thread on this mailinglist that suggested to use
>><myClass>BeanInfo classes, and that worked great. Untill I found out
>>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
>>TypeDesc, trying to fake those fields I did not need as attributes.
>>also doesn't work because those fields still get serialized only as
>>attribute instead of elements. minOccurs=0 in the TypeDesc also won't
>>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
>>hope to override beanserializer and do the serializing myself. The
>>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"
>>	<parameter name="allowedMethods" value="*"/>
>>	<parameter name="scope" value="application"/>
>>	<namespace></namespace>
>>Maurice Marrink

View raw message