cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: JAXB and REST Response
Date Sat, 09 Apr 2011 15:17:47 GMT
Hi

Do you mean you'd like to prevent malformed XML being sent back, in case
when JAXB failed to finish the serializaton process ? The only option here
is to cash the response, use an "enableBuffering' and 'enableStreaming'
properties, see

http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-ConfiguringJAXBprovider

thanks, Sergey

On Sat, Apr 9, 2011 at 1:25 AM, wsdev <steve@daskam.com> wrote:

> Hi,
>
> I'm creating a RESTful service with CXF that creates a resource when the
> user POSTs some XML. The service works fine when the XML is valid, but when
> I send some bad XML, JAXB can't convert it to my java bean and sends back a
> 500 Internal Server error. How can I make it so that if bad XML is sent to
> my service, I capture it and send back a 400 Bad Request response.
>
> Any help is greatly appreciated!!
>
> Thanks,
> Steve
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/JAXB-and-REST-Response-tp4292165p4292165.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message