File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes UnsupportedMediaException : Unsupported content-type:text/html; Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "UnsupportedMediaException : Unsupported content-type:text/html;" Watch "UnsupportedMediaException : Unsupported content-type:text/html;" New topic

UnsupportedMediaException : Unsupported content-type:text/html;

Somak Dalui
Ranch Hand

Joined: Apr 19, 2005
Posts: 40
Hi, I have generated the client Java files by accessing the remote WSDL file through 'wsimport' tool.
Now when I am trying to invoke the service I am getting this UnsupportedMediaException : Unsupported content-type:text/html; charset=utf-8 Supported ones are: [text/xml].

I have seen the others posts related to the same topic but are of little use to me. I dont have any kind of local WSDL file, my @WebServiceClient annotation attributes are all fine and I am just running a standalone Java class as client.

Here's my Ant wsimport task

And this is my Java client code -

Please help me on this. I can understand instead of xml what I am getting back is text/html, but have little clue how to advance further.
Let me know of you need to see more code of anything.
Somak Dalui
Ranch Hand

Joined: Apr 19, 2005
Posts: 40
Just set this VM property to view the detailed response
It is sorta covered in the JavaRanch Style Guide.
subject: UnsupportedMediaException : Unsupported content-type:text/html;