String contentType = MediaType.APPLICATION_OCTET_STREAM;
Consumes consumes = ((JavaOperation)operation).getJavaMethod().getAnnotation(Consumes.class);
if (consumes != null && consumes.value().length > 0) {
contentType = consumes.value()[0];
}
WireFormat wf = binding.getRequestWireFormat();
if (wf != null) {
if (XMLWireFormat.REST_WIREFORMAT_XML_QNAME.equals(wf.getSchemaName())) {
contentType = MediaType.APPLICATION_XML;
} else if (JSONWireFormat.REST_WIREFORMAT_JSON_QNAME.equals(wf.getSchemaName())) {
contentType = MediaType.APPLICATION_JSON;
}
}
return contentType;
}