From: Bill B. <bb...@re...> - 2013-08-07 12:04:57
|
I dont understand your problem. You invoke a HTTP GET request on the DataExport service, works fine. What does "method inside JBoss Application server" mean? On 8/7/2013 3:19 AM, Arnd Schröter wrote: > Hello together, > > i am using RESTeasy to collect XML data from an external REST-API. It > looks like: > > @Produces("application/xml") > public interface DataExport { > > @GET > @Path("results.htm") > Summary getData(@QueryParam("filterRule") final String filterRule, > @QueryParam("startTime") final long startTime, @QueryParam("endTime") > final long endTime, @QueryParam("attributeSieve") final String > attributeSieve) throws Exception; > } > > The returned Summary is a JAXB generated class based on a XSD. > > Calling this method outside a JBoss Application server works fine since > RESTeasy internally uses the "JaxBXmlRootElemtProvider" message body > reader to convert the XML string into the required object. > Calling this method inside a JBoss Application server as part of a bean > throws an exception saying that String cannot be casted to Summary. I > found out that this comes from the fact that internally another message > body reader is used, namely the "YamlProvider". > > What i found out is that this is connected to the response of the query > which does not contain a content type. Since in the readers list the > YamlProvider comes before JaxBXmlRootElemtProvider the YamlProvider is > chosen which cannot convert the data. > > Do you have any idea how i can solve this issue despite adding the > content type to the response? > > Thank you in advance, > Arnd > > > ------------------------------------------------------------------------------ > Get 100% visibility into Java/.NET code with AppDynamics Lite! > It's a free troubleshooting tool designed for production. > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |