Inconsistent response when throwing WebApplicationException with or without
message in Response object
------------------------------------------------------------------------------------------------------
Key: CXF-3782
URL: https://issues.apache.org/jira/browse/CXF-3782
Project: CXF
Issue Type: Bug
Components: JAX-RS
Affects Versions: 2.4.2
Reporter: Radosław Janas
I'm using cxf rest impl.
I wrote simple rest service which takes xml body.
When I throw WebApplicationException with Response object containing message
(cxf makes it internally i.e. when xml is not schema valid):
{code}
Response r =
Response.status(400).type(MediaType.TEXT_PLAIN).entity(message).build();
throw new WebApplicationException(t, r);
{code}
... I get 400 Bad Request with text body
When I throw WebApplicationException Response object NOT containing message
(cxf makes it internally i.e. when request body is empty):
{code}
Response r = Response.status(400).type(MediaType.TEXT_PLAIN).build();
throw new WebApplicationException(t, r);
{code}
... I get 200 OK.
Why ?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira