atom feed1 message in org.apache.cxf.userRE: Hide/Ignore a pojo field
FromSent OnAttachments
Maxime OrainOct 10, 2008 9:45 am 
Subject:RE: Hide/Ignore a pojo field
From:Maxime Orain (Maxi@thomsonreuters.com)
Date:Oct 10, 2008 9:45:31 am
List:org.apache.cxf.user

Thanks you it works now!!! :)

I made a little sample to describe my bug and I realized that I packaged old pojos which doesn't contain any annotations...

To Ignore a field you need to do what Nafis said. Thanks again!!!

-----Original Message----- From: Daniel Kulp [mailto:dku@apache.org] Sent: 09 October 2008 20:18 To: use@cxf.apache.org Cc: Maxime Orain Subject: Re: Hide/Ignore a pojo field

On Thursday 09 October 2008 2:04:09 pm Maxime Orain wrote:

Daniel, Nafis,

Thank you very much... now my another problem why the JAXB annotations are not taken by CXF... do you have an idea? (I cannot test :( )

That one I have no idea without a full testcase (war or ant/maven project preferred). We pretty much just pass the classes to the jaxb ri and let it do it's thing. We don't process the jaxb annotations (usually, certain

cases we have to).

Thanks for your help

-----Original Message----- From: Nafis Zebarjadi [mailto:nzeb@coindata.com] Sent: 09 October 2008 19:55 To: use@cxf.apache.org Subject: RE: Hide/Ignore a pojo field

Max,

Take a look at JAXB's @XmlAccessorType which controls whether to marshal fields (i.e. public/private members) or properties (via getter/setter methods). Another option is to force explicit control over what gets included in the output using XmlAccessType.NONE:

@XmlAccessorType(XmlAccessType.NONE) public class MyDefinedPojo { // include this in the generated XML @XmlElement protected String left;

// since we set access type to XmlAccessType.NONE, // we can leave out @XmlElement and this field will not be marshalled protected String right;

... }

JavaDoc for the JAXB package (javax.xml.bind.annotation) has more details.

/n

-----Original Message----- From: Daniel Kulp [mailto:dku@apache.org] Sent: Thursday, October 09, 2008 1:34 PM To: use@cxf.apache.org Cc: Maxime Orain Subject: Re: Hide/Ignore a pojo field

Max,

You MAY need to put the @XmlTransient annotation on the getter and setter as well. I'm not really sure where JAXB is going to look for it.

Dan

On Thursday 09 October 2008 4:35:43 am Maxime Orain wrote:

Hello Dan, (and others of course ;) )

Thanks for your help!

I tried to use the @XmlTransient but it didn't work I think I've got problem with JAXB annotations. Is there restrictions? Is it

compatible

with CXF 2.1.1? Is more configuration needs to be written?

Thanks again

Max.

-----Original Message----- From: Daniel Kulp [mailto:dku@apache.org] Sent: 08 October 2008 22:02 To: use@cxf.apache.org Subject: Re: Hide/Ignore a pojo field

There is an @XmlTransient annotation to mark fields as transient

from

a

jaxb standpoint.

Dan

On Wednesday 08 October 2008 2:06:19 pm Maxime Orain wrote:

Hello

Another question... how it's possible to hide a pojo field?

I don't want that right field appears on the generated WSDL. Is

a

method

exists to hide or to ignore a field?

public class MyDefinedPojo

{

protected String left;

protected String right;

public MyDefinedPojo() {}

public String getLeft() { return this.left; }

public void setLeft(String data) { this.left=data; }

public String getRight() { return this.right;

}

public void setRight(String data) { this.right=data; }

}

Thanks for your help!

This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are

those

of

the

individual sender, except where the sender specifically states

them

be

the views of Thomson Reuters.

This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.

This email was sent to you by Thomson Reuters, the global news and information
company. Any views expressed in this message are those of the individual sender, except
where the sender specifically states them to be the views of Thomson Reuters.