On 04/01/13 13:48, jbright wrote:
I'm determining the requests from the REST service call for both XML and JSON
like below:

In *public Response handleRequest(Message message, ClassResourceInfo
resourceClass)*

/MediaType mediaType = httpHeaders.getMediaType();
if(mediaType.equals(MediaType.valueOf("application/xml;charset=UTF-8"))){
        response = handleJaxbRequest(message);
} else if
(mediaType.equals(MediaType.valueOf("application/json;charset=UTF-8"))){
        response = handleJsonRequest(message);
} else {
        log.info("neither xml nor json, so bad request");
        return Response.status(Status.BAD_REQUEST).build();
}/

After authenticating in each methods, like below:

/if (SpaAuthentication.authenticate(loginCredentials)){
        log.info("--isAuthorized if--");                              
        return null;  // Response
} else {
        return Response.status(Status.UNAUTHORIZED).build();
}/

Once the Response is returned as null, the control flows to the service bean
method invocation.

Apparently when the media type is XML, the control flow is successful.

But when the media type is JSON, the control flow fails right after the
'return null;' statement...

badly no exception / error is getting printed/logged anywhere in the log
files...

whereas, I get 500 Internal Server Error in the REST client.


Are you saying that if a JSON request is allowed to proceed then it fails ? Can you provide more info please ?

Thanks, Sergey

Help pls



--
View this message in context: 
http://cxf.547215.n5.nabble.com/JSON-Request-fails-after-interception-REST-tp5720968.html
Sent from the cxf-user mailing list archive at Nabble.com.


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to