I am learning JAX-WS and i also was introduced with JAXB. I can use it to (un)marshal java(xml) to xml(java). But what is the purpose of this line then i generated my WS data with Apache CXF:
@XmlElementRef(name = "Id", namespace = "External.Test", type = JAXBElement.class, required = false)
protected JAXBElement<String> id;
- Why it can't be just
String id
instead ofJAXBElement<String> id
? - How can I convert request data (let's say java POJO) into structure like this above? (I am talking about mapping from POJO to this exposed WS structure with fields wrapped into JAXBElements)