This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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: 41
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: 41
Just set this VM property to view the detailed response
Have you checked out Aspose?
subject: UnsupportedMediaException : Unsupported content-type:text/html;
It's not a secret anymore!