if (args instanceof Object[]) {
params = (Object[])args;
}
JsonRpcRequest req = null;
if (JSONRPCBinding.VERSION_20.equals(((JSONRPCBinding)endpointReference.getBinding()).getVersion())) {
req = new JsonRpc20Request(requestId, msg.getOperation().getName(), params);
} else {
req = new JsonRpc10Request(requestId, msg.getOperation().getName(), params);
}
final JsonRpcRequest json = req;
// Create content producer so that we can stream the json result out
ContentProducer cp = new ContentProducer() {
public void writeTo(OutputStream outstream) throws IOException {
// mapper.writeValue(outstream, req.toJSONObject().toString());
try {
json.write(outstream);
} catch (Exception e) {
throw new IOException(e);
}
}
};