Hide an entity variable from xml message
I have an 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 an object of the class via xml in jax-ws web service like 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 it possible to not sent one of the variables such as customerId, which
the client shouldn't see? I have added @XmlTransient, but no change.
No comments:
Post a Comment