cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin" <sbery...@progress.com>
Subject Re: Aegis + JSON ---> is it supported?
Date Mon, 15 Jun 2009 09:22:47 GMT
Hi,

I'm assuming it's an xml format which is not served, so try :

>    @Produces({"application/xml", "application/json"})

this should help....

cheers, Sergey

> 
> I get the following error when I try to make Aegis and JSON work in JAX-RS:
> 
> Jun 14, 2009 3:07:56 PM org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor
> writeResponseErrorMessage
> WARNING: .No message body writer found for response class : Response.
> 
> Note: Response is my custom class as shown below.
> 
>    @GET
>    @Path("/getquery")
>    @Produces({"application/json"})
> public Response greetQuery(@QueryParam("name") String
> name,@QueryParam("language") String language) { ..... }
> 
> @XmlRootElement(name = "resp")
> public class Response {
> public Response(){}
> public String getGreeting() {
> return greeting;
> }
> public void setGreeting(String greeting) {
> this.greeting = greeting;
> }
> public Error[] getErrors() {
> return errors;
> }
> public void setErrors(Error[] errors) {
> this.errors = errors;
> }
> String greeting;
> Error[] errors;
> 
> }
> I
> have the following config in my beans.xml
> 
>       <bean id="aegisProvider"
> class="org.apache.cxf.jaxrs.provider.AegisElementProvider" />
> <jaxrs:server id="demoCXFServiceRS" address="/">
> <jaxrs:serviceBeans>
> <ref bean="demoCXF" />
> </jaxrs:serviceBeans>
> <jaxrs:providers>
> <ref bean="aegisProvider"/>
> </jaxrs:providers>
> </jaxrs:server>
> 
> What am I missing??
> 
> Thanks,
> - parin
> 
> 
> 
> Sergey Beryozkin-2 wrote:
>> 
>> Hi
>> 
>> If you do JAX-RS then you can use Aegis and JSON providers in tandem,
>> Aegis will handle application/xml requests, JSON one will deal with
>> application/json.
>> 
>> If you use Aegis as part of SOAP processing, then you can still annotate
>> the same bean with JAX-RS annotations and register a jax-rs endpoint on
>> the same port and have JSON supported.
>> 
>> Cheers, Sergey 
>> 
>> -----Original Message-----
>> From: Parin [mailto:pkenia@yahoo-inc.com] 
>> Sent: 14 June 2009 20:50
>> To: users@cxf.apache.org
>> Subject: Aegis + JSON ---> is it supported?
>> 
>> 
>> I just want to confirm that if Aegis is used as the data binding then
>> JSON is
>> not supported in CXF 2.1.x and CXF 2.2.x. I couldn't find any
>> documentation
>> stating that or otherwise and I wasn't successful in my test code as
>> well.
>> 
>> Thanks,
>> - parin
>> -- 
>> View this message in context:
>> http://www.nabble.com/Aegis-%2B-JSON----%3E-is-it-supported--tp24025149p
>> 24025149.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>> 
>> 
>> 
> 
> -- 
> View this message in context: http://www.nabble.com/Aegis-%2B-JSON----%3E-is-it-supported--tp24025149p24026292.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

Mime
View raw message