public void testJSONRPCBinding() throws Exception {
JSONObject jsonRequest = new JSONObject("{ \"method\": \"echo\", \"params\": [\"Hello JSON-RPC\"], \"id\": 1}");
WebConversation wc = new WebConversation();
WebRequest request = new PostMethodWebRequest( SERVICE_URL, new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")),"application/json");
WebResponse response = wc.getResource(request);
assertEquals(200, response.getResponseCode());
JSONObject jsonResp = new JSONObject(response.getText());
assertEquals("echo: Hello JSON-RPC", jsonResp.getString("result"));