users@jersey.java.net

How to assign MessageBodyReader to accept another MIME

From: Turner, George <george.turner_at_lmco.com>
Date: Thu, 08 Oct 2009 17:45:20 -0600

Many times service providers output multiple content types for xml. It is usually plain/text, application/xml, etc, etc.
KML is output as application/vnd.google-earth, but to a JAXB unmarshaller, it is really just application/xml.
What I am looking for is a way to do this:

      ClientConfig config = new DefaultClientConfig();
      Client client = Client.create(config);
      WebResource webResource = client.resource(url);
      KmlType kml = webResource.
          accept("plain/text", "application/xml", "application/vnd.google-earth").get(KmlType.class);

And not get the ANNOYING error message that a message body reader has not been registered for KmlType and application/vnd.google-earth.

Any help is GREATLY appreciated.

Thanks

Gene

George (Gene) Turner
[cid:image001.png_at_01CA483E.C8B52F50]
Senior Staff Software Engineer
Information Systems & Global Services
Work:(719) 277-5244 Cell:(719) 237-0490
george.turner_at_lmco.com<mailto:george.turner_at_lmco.com>







image001.png
(image/png attachment: image001.png)