Doc Holiday
Doc Holiday

Reputation: 10254

Java @POST Webservice 415 Unsupported Media Type

I have read through all the other posts, but seem to be getting this issue not sure why:

JAVA:

@Path("/acct")
public class MyService
{

    @Path("/create")
    @POST
    @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public MyClass myClass( AccountForm aform ) throws exception
    {       
       System.out.println("MYtest");
    }
}

POSTER CLIENT: enter image description here

I see this in the logs:

SEVERE: A message body reader for Java type, class AccountForm, and MIME media type, application/xml;charset=UTF-8, was not found

Upvotes: 0

Views: 344

Answers (1)

user2122031
user2122031

Reputation: 601

Hard to know for sure but in the header tab of your poster tool add a header called accept and set it to application/xml.

Upvotes: 1

Related Questions