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 Jianliang Zhao <jz...@zaplet.com> on 2002/09/10 02:33:20 UTC

RE: BeanSerializer bug (WAS: rc1 serializes fields with public getters but no setters)

I saw the same behavior on bean properties with only getter methods. How to configure WSDD file to disable those fields? I didn't find any documentation for doing this.

-----Original Message-----
From: Navneet Joneja [mailto:njoneja@interwoven.com]
Sent: Monday, September 09, 2002 5:29 PM
To: 'axis-user@xml.apache.org'
Cc: 'axis-dev@xml.apache.org'
Subject: RE: BeanSerializer bug (WAS: rc1 serializes fields with public getters but no setters)


Ivan,
I agree - I think there is a bug in the BeanSerializer, but not quite in the way you describe.
 
First - the solution to your problem - I believe that if you want to NOT serialize the field, I believe you could change the wsdd file so that this field does not get serialized.
 
As a matter of fact, I think the fact that the BeanSerializer does not deserialize beans (information based off beta 3, so if this has changed, I apologise) without a public setter method is a bug. This prevents you from making an object immutable AFTER deserialization. Compare the behavior of the BeanSerializer with the Java Serialization mechanism which serializes EVERYTHING except transient fields. The BeanSerializer should be able to do the same.
 
As an illustrative example, consider the following interface:
 
public interface AccountService extends java.rmi.Remote {
    public AccountData getAccountData();
    // other methods
}
 
class AccountData  {
    float balance;
    public float getBalance() {
        return balance;
   }
 
    private void setBalance(float balance) {
        this.balance=balance;
    }
 
    //other bean properties
}
 
So basically this interface wants to return all the information about the account as a single object to reduce granularity - the AccountData object.
Now the AccountData should be immutable once deserialized. Setting the value of, say, the balance attribute of the bean on the client side will have no effect and its presence in the public API would only serve to confuse users.
 
BeanSerializer should be able to handle such classes correctly but alas, does not. 
 
- Navneet
 
 -----Original Message-----
From: Ivan Filippenko [mailto:Ivan.V.Filippenko@aero.org]
Sent: Monday, September 09, 2002 4:23 PM
To: axis-user@xml.apache.org
Subject: rc1 serializes fields with public getters but no setters




This is new and annoying.  If I have a public method getURL() 
but no corresponding setter (and no instance variable, either), 
AXIS rc1 creates a <URL> field in the XML serialization.  But I 
don't want this field, because there are no provisions to deserialize it! 

This is new since Beta3, and looks like a bug, no? 

Thanks, 

  -- Ivan 



how to integrate Axis into specific system

Posted by Weicheng Peng <we...@voxa.com>.
Hi 

I want to use axis as my soap engine, then I can deploy web service in my own system , which is a simple web server , not tomcat nor apache.
Does anyone have such experience ?

thanks in advance.

Weicheng