Hi Ganesh

I'm forwarding it to the users list

I wonder if you are looking for JSONP or similar approaches ?
Have a look at this documentation:

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

Cheers, Sergey

On 24/03/12 11:10, Ganesh wrote:
Hi All,

We have a two issues related to receiving *"application/json"* response from
CXF REST API.

1) When we do a file upload from ajax form submit we are receiving the
inline XML response for successful uploads. But actually we need it as JSON
response to handle in AJAX/JQUERY.
In the server side api we used *@Consumes("multipart/form-data")* which can
accept file upload along with form data.

We tried to add *@Produces("application/json")* in the server side API.
After adding this we are able to get JSON response, But it's opening in the
popup and asking users to download it. Which is a bad experience to the
user.

We are looking for the solution to retrieve it as inline rather than asking
download.


2) The second issue is we have an API to download CSV file from server side.

In the API we used *@Produces("text/csv", "application/json")* and the
response class is *javax.ws.rs.core.Response*

Everything is working fine for the happy flows. But we have a use case to
handle the error scenario and customized error message needs to be displayed
to the user. For this we need to receive the JSON response as inline rather
than asking for download in the popup window.

Is there any possible solutions to achieve this ?


Could any one please tell us the approach to resolve these issues?


Regards,
Ganesh.

--
View this message in context: 
http://cxf.547215.n5.nabble.com/Not-able-to-receive-inline-JSON-response-for-Multipart-API-tp5591532p5591532.html
Sent from the cxf-dev mailing list archive at Nabble.com.


--
Sergey Beryozkin

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

Blog: http://sberyozkin.blogspot.com

Reply via email to