java - Hide an entity variable from xml message - @XmlTransient not working -
i have entity class:
public class customer implements serializable { private static final long serialversionuid = 1l; @xmltransient @id @generatedvalue(strategy = generationtype.identity) @basic(optional = false) @column(name = "customer_id") private integer customerid; @basic(optional = false) @notnull @size(min = 1, max = 30) @column(name = "name") private string name; @basic(optional = false) @notnull @size(min = 1, max = 30) @column(name = "addressline1") private string addressline1; @basic(optional = false) . . . .
i sent object of class via xml in jax-ws web service so:
<addressline1>bunkilla</addressline1><addressline2>donoughmore</addressline2><city>cork</city><country>ireland</country><creditlimit>10</creditlimit><customerid>1</customerid><email>davidmurray06@gmail.com</email><fax>0217337330</fax><name>david</name><owner>david</owner><phone>0217437661</phone><province>munster</province><zip>02</zip>
is possible not sent 1 of variables such customerid, client shouldn't see? have added @xmltransient, no change.
by default public properties serialized xml. need mark corresponding get
method @xmltransient
. if wish annotate fields can add following class @xmlaccessortype(xmlaccesstype.field)
.
for more information
Comments
Post a Comment