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 "Bell, Douglas" <DB...@boingo.com> on 2006/08/18 21:43:41 UTC

Axis 1.4 beanMapping within wsdd ignores bean methods and generates both getters and setters from fields.

I can't find any documentation describing the beanMapping process so I
am unsure if this is a bug or a feature...

I have the following beanMapping within my wsdd:

<beanMapping qname="myNS:TestObject" xmlns:myNS="http://test.boingo.com"
languageSpecificType="java:com.boingo.test.TestObject"/>

The Object being mapped is as follows (notice there is no setIntgr()
defined, I do not want to expose this to the client):

public class TestObjectDTO
implements Serializable
{
    /** serialVersionUID */
    private static final long serialVersionUID = -8521313678848845583L;

    /** */
    protected String str;
    
    /** */
    protected Integer intgr;
    
    /**
     * Default Constructor
     *
     */
    public TestObjectDTO() {
        
    }
    
    /**
     * Returns the intgr
     *
     * @return Integer Returns the intgr.
     */
    public Integer getIntgr() {
        return intgr;
    }
  
    /**
     * Returns the str
     *
     * @return String Returns the str.
     */
    public String getStr() {
        return str;
    }
    
    /**
     * Sets the str
     *
     * @param str The str to set.
     */
    public void setStr(String str) {
        this.str = str;
    }
}

When I generate the client stubs it creates a setIntgr(Integer intgr)
method for me. It appears it is ignoring the beans methods and only
looking at the fields. This is unwanted behavior in my eyes. If I have a
accountBalance field on a bean, I would probably want a
getAccountBalance() method, but not a setAccountBalance(). 

Any way around this?

- Doug


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org