abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincenzo Vitale <vincenzo.vit...@gmail.com>
Subject Fwd: Xml directive in the atom feed response
Date Tue, 16 Jun 2009 13:02:25 GMT
Hi,
I'm using CXF 2.2 exposing a webservice with Atom. The xml directive is
missing... and I would like to avoid extending the AtomFeedProvider class.
Do you have any suggestion?


Thanks in advance,
Vicio.

---------- Forwarded message ----------
From: Sergey Beryozkin <sberyozk@progress.com>
Date: Tue, Jun 16, 2009 at 11:10 AM
Subject: Re: Xml directive in the atom feed response
To: users@cxf.apache.org


Hi,

I think you might want to ask the question on the Abdera list or check their
archives, I haven't found anything obvious.
Feed may contain multiple entries with different contents and it's possible
to set a media type on the individual Abdera entry content instance, ex,
"application/xml;charset=utf-8", perhaps same is possible on the top-level
Feed itself or on Entry.
Another option is to extend AtomFeedProvider and in its writeTo() method
just write this xml directive directly to the output stream and then
delegate to the super class. At the moment AtomFeedProvider &
AtomEntryProvider are not related really to each other, I'll fix it and wire
them together and enhance a bit too.

cheers, Sergey


----- Original Message ----- From: "Vincenzo Vitale" <
vincenzo.vitale@gmail.com>
To: <users@cxf.apache.org>
Sent: Monday, June 15, 2009 12:55 PM
Subject: Xml directive in the atom feed response



When exposing a webservice using the Atom provider and xml the <?xml
version=”1.0” encoding=”utf-8”?> directive is not added.
Is there a way to fix this?

the method exposed is:

  @GET
  @Path("/{skus}")
  public Feed getProductDetails(...){
       ...
      Feed feed = abdera.newFeed();
      feed.setTitle("TomTom Feed");
      feed.setSubtitle("ProductDetails feed");
      ...

     return feed;
    }



and in the spring conf:

  <jaxrs:server id="atomProductRestWebService" address="/product">
      <jaxrs:serviceBeans>
          <ref bean="atomProductWebService" />
      </jaxrs:serviceBeans>
      <jaxrs:providers>
          <bean class="org.apache.cxf.jaxrs.provider.AtomFeedProvider" />
      </jaxrs:providers>
  </jaxrs:server>

where atomProductWebService is the class with the getProductDetails
implemented.

Is there something special I need to add?



Thanks,
Vicio.

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