I’ve built up a Webservice in Java using Jersey.
The Webservice consumes XML and takes a POJO (CoResponse) as MethodParameters.
I.E.
@PUT
@Consumes(MediaType.APPLICATION_XML)
public CoResponse test(CoResponse obj){
//...do something....
return obj;
}
On Client side I would do a Put Request like this…
CoResponse rO = service.path("path")
.type(MediaType.APPLICATION_XML_TYPE)
.accept(MediaType.APPLICATION_XML)
.put(CoResponse.class, new CoResponse());
Actually everything is working fine in our environment. But now I would like to know what the xml-string sent to the Server looks like. The reason why is to use the webservice also in other environments by creating a custom Serializer / Deserializer (i.e. for windows mobile) that is compatible to our jersey webservice.
Is there a way of looking into the put method to see the final xmlstring? Or some other possibilities?
Use a LoggingFilter.
Just add it to your client: