You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Brett Wooldridge <bw...@alterpoint.com> on 2007/07/31 21:00:18 UTC
Excluding attributes?
If I am doing Java first development, and I have an SEI like so:
public interface FooSEI
{
Bar getBar();
}
And a data class like this:
public class Bar
{
private int x;
private String s;
public int getX()
{
...
}
public String getStr()
{
...
}
}
Is there an annotation or some other mechanism by which I can exclude the
"s" attribute of Bar from the WSDL generation? For example, bar.getStr()
should only be available on the server-side, whereas the public API with
respect to the client only contains the 'x' attribute (bar.getX()).
Thanks,
Brett
Re: Excluding attributes?
Posted by Brad Harper <br...@gmail.com>.
Try adding @WebMethod(exclude = true) annotation to any method in
your Impl that you don't want to expose in your WSDL. (from a post yesterday
- I've not verified it)
On 7/31/07, Brett Wooldridge <bw...@alterpoint.com> wrote:
>
> If I am doing Java first development, and I have an SEI like so:
>
> public interface FooSEI
> {
> Bar getBar();
> }
>
> And a data class like this:
>
> public class Bar
> {
> private int x;
> private String s;
>
> public int getX()
> {
> ...
> }
>
> public String getStr()
> {
> ...
> }
> }
>
> Is there an annotation or some other mechanism by which I can exclude the
> "s" attribute of Bar from the WSDL generation? For example, bar.getStr()
> should only be available on the server-side, whereas the public API with
> respect to the client only contains the 'x' attribute (bar.getX()).
>
> Thanks,
> Brett
>
>
Re: Excluding attributes?
Posted by Daniel Kulp <dk...@apache.org>.
Brett,
Assuming JAXB databinding, there is an @XmlTransient annotation that can
be used to mark public fields/properties as transient for the purpose of
the schema/xml.
Dan
On Tuesday 31 July 2007 15:00, Brett Wooldridge wrote:
> If I am doing Java first development, and I have an SEI like so:
>
> public interface FooSEI
> {
> Bar getBar();
> }
>
> And a data class like this:
>
> public class Bar
> {
> private int x;
> private String s;
>
> public int getX()
> {
> ...
> }
>
> public String getStr()
> {
> ...
> }
> }
>
> Is there an annotation or some other mechanism by which I can exclude
> the "s" attribute of Bar from the WSDL generation? For example,
> bar.getStr() should only be available on the server-side, whereas the
> public API with respect to the client only contains the 'x' attribute
> (bar.getX()).
>
> Thanks,
> Brett
--
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727 C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog