0

I want to send a POST request to test my local webservice. The request body is an XML body and i generated the classes using JAXB.

Everything is fine but when I execute the following code

ClientResponse response = service.path("api")
                    .path("v1")
                    .path("shipments")
                    .path("package")
                    .path("order")
                    .path("status")
                    .accept(MediaType.APPLICATION_XML)
                    .post(ClientResponse.class, orderStatusRequest);

I get the following error

com.sun.jersey.api.client.ClientHandlerException: A message body writer for Java type, class com.api.shipments.model.OrderStatusRequestType, and MIME media type, application/octet-stream, was not found

Can someone point me to a direction, what i am missing here?

Em Ae
  • 8,167
  • 27
  • 95
  • 162
  • duplicate of http://stackoverflow.com/questions/7832760/a-message-body-writer-for-java-type-class-mypackage-b-and-mime-media-type-app ? – keiki Aug 20 '12 at 21:53
  • Can you provide the signature of your server side method? – condit Aug 20 '12 at 22:54
  • 1
    I think that `orderStatusRequest` String is not in a right xml format! can you share it also? – Ali Aug 22 '12 at 16:33
  • Yup, that was the problem. I figure it out long ago but didn't get chance to update this question. You can post it as a reply and i can accept your answer. – Em Ae Aug 22 '12 at 23:44

0 Answers0