Jettison is the default provider behind Jaxb in CXF. You can also use Jackson which is more efficient.
-- Jean-Louis Monteiro http://twitter.com/jlouismonteiro http://www.tomitribe.com On Tue, Sep 9, 2014 at 3:21 PM, Jonathan Fisher < [email protected]> wrote: > Thanks! (as always) > > Is there a way too swap Jetison versions? I think we're on 1.6.0.2 in > prod... > > Jonathan S. Fisher > Spring Venture Group > Sent on the go; I blame the spelling and grammar mistakes on my phone. > On Sep 9, 2014 12:00 AM, "Romain Manni-Bucau" <[email protected]> > wrote: > > > Hi > > > > That was jettison behavior. This is fixed with cxf 3. > > > > Ps: here is the jira enhancing it > > https://jira.codehaus.org/plugins/servlet/mobile#issue/JETTISON-126 > > Le 9 sept. 2014 02:43, "Jonathan Fisher" < > [email protected] > > > > > a écrit : > > > > > Consider this request: > > > > > > { > > > "call" : { > > > "type" : "Call", > > > "subject" : null > > > } > > > } > > > > > > This object: > > > > > > @XmlRootElement(name = "call") > > > @XmlAccessorType(XmlAccessType.NONE) > > > public class ApiCallActivity { > > > @NotNull > > > @XmlElement(name = "type") > > > public String type; > > > > > > @Size(min = 1, max = 255) > > > @XmlElement(name = "subject") > > > public String subject; > > > } > > > > > > And this webservice: > > > > > > @ApplicationScoped > > > @Path("/") > > > @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) > > > @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) > > > public class CallActivityController { > > > @Inject > > > private Logger log; > > > @Inject > > > private BeanValidator validator; > > > @EJB > > > private CallActivityService callActivityService; > > > > > > @Path("/") > > > @POST > > > public void postCall(ApiCallActivity apiCall) { > > > log.info("postCall() apiCall.subject:{}", apiCall == null ? null : > > > apiCall.subject); > > > } > > > } > > > > > > How come subject is a 0 length string "" not null... like a surprised > > > individual might discover? Is there a way to make null be null? > > > > > > > > > *Jonathan Fisher* > > > *VP - Information Technology* > > > *Spring Venture Group* > > > > > > -- > > > Email Confidentiality Notice: The information contained in this > > > transmission is confidential, proprietary or privileged and may be > > subject > > > to protection under the law, including the Health Insurance Portability > > and > > > Accountability Act (HIPAA). The message is intended for the sole use of > > the > > > individual or entity to whom it is addressed. If you are not the > intended > > > recipient, you are notified that any use, distribution or copying of > the > > > message is strictly prohibited and may subject you to criminal or civil > > > penalties. If you received this transmission in error, please contact > the > > > sender immediately by replying to this email and delete the material > from > > > any computer. > > > > > > > -- > Email Confidentiality Notice: The information contained in this > transmission is confidential, proprietary or privileged and may be subject > to protection under the law, including the Health Insurance Portability and > Accountability Act (HIPAA). The message is intended for the sole use of the > individual or entity to whom it is addressed. If you are not the intended > recipient, you are notified that any use, distribution or copying of the > message is strictly prohibited and may subject you to criminal or civil > penalties. If you received this transmission in error, please contact the > sender immediately by replying to this email and delete the material from > any computer. >
