Quantcast

Unsupported Media Type even for application/xml

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Unsupported Media Type even for application/xml

SetNug
Hi all,

I'm publishing method to be accessed via REST without specifying @Consumes, so I assume I can send XML payload along with Content-Type: application/xml, but this does not seem to be the case since I keep failing with the following error:

2017-05-08 18:13:50,873 | ERROR | p1826628273-2034 | JAXRSUtils                       | 46 - org.apache.cxf.cxf-rt-frontend-jaxrs - 3.1.1 | No message body reader has been found for class com.modulariti.facade.remote.hr.EmployeeDTO, ContentType: application/xml
2017-05-08 18:13:50,873 | WARN  | p1826628273-2034 | WebApplicationExceptionMapper    | 46 - org.apache.cxf.cxf-rt-frontend-jaxrs - 3.1.1 | javax.ws.rs.WebApplicationException: HTTP 415 Unsupported Media Type

I tried also using @Consumes("application/xml"), but the error persists.

I've got this method working for sometime even without adding Content-Type information in the header, but suddenly it stops working.

Any help would be greatly appreciated.

Thanks & Regards,
SetNug

 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unsupported Media Type even for application/xml

Sergey Beryozkin
Administrator
Hi

Can you try CXF 3.1.11 ?

Cheers, Sergey
On 08/05/17 13:05, SetNug wrote:

> Hi all,
>
> I'm publishing method to be accessed via REST without specifying @Consumes,
> so I assume I can send XML payload along with Content-Type: application/xml,
> but this does not seem to be the case since I keep failing with the
> following error:
>
> 2017-05-08 18:13:50,873 | ERROR | p1826628273-2034 | JAXRSUtils
> | 46 - org.apache.cxf.cxf-rt-frontend-jaxrs - 3.1.1 | No message body reader
> has been found for class com.modulariti.facade.remote.hr.EmployeeDTO,
> ContentType: application/xml
> 2017-05-08 18:13:50,873 | WARN  | p1826628273-2034 |
> WebApplicationExceptionMapper    | 46 - org.apache.cxf.cxf-rt-frontend-jaxrs
> - 3.1.1 | javax.ws.rs.WebApplicationException: HTTP 415 Unsupported Media
> Type
>
> I tried also using @Consumes("application/xml"), but the error persists.
>
> I've got this method working for sometime even without adding Content-Type
> information in the header, but suddenly it stops working.
>
> Any help would be greatly appreciated.
>
> Thanks & Regards,
> SetNug
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Unsupported-Media-Type-even-for-application-xml-tp5780274.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unsupported Media Type even for application/xml

SetNug
Hi Sergey,

Thank you for your suggestion.

I'm using CXF 3.1.1 since it comes with Apache Karaf 4.0.8 and I've managed to get it working for couple days before abruptly broken.

I've tried another method with simple String argument and it works fine.

Regards,
SetNug
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unsupported Media Type even for application/xml

SetNug
Hi Sergey,

The problem only exists if I use Equinox framework instead of Felix.

I'm not sure what's the difference between the 2 in this case, would appreciate if someones gives me information on this.

Regards,
SetNug
Loading...