I have Json RPC Server written in Java and I have no code of it.
$headers = array(
'Content-Type: application/json',
'Accept: application/json'
);
$url="https://127.0.0.1:9999";
$pemfile = "C:\\openssl\\client.cer";
$keyfile = "C:\\openssl\\client.openssl";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
$post = array(
"jsonrpc" => "2.0",
"method" => "generateAddress",
"id" => "1");
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
curl_setopt($ch, CURLOPT_SSLCERT, $pemfile);
curl_setopt($ch, CURLOPT_SSLCERTTYPE, 'PEM');
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, '');
curl_setopt($ch, CURLOPT_SSLKEY, $keyfile);
curl_setopt($ch, CURLOPT_SSLKEYPASSWD, '');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$data = curl_exec($ch);
$curl_errno = curl_errno($ch);
$curl_error = curl_error($ch);
print_r($data);
In specification server should respond:
{"id":1,"error":{"message":"Internal error","code":-32603},"jsonrpc":"2.0"}
But server is responding nothing and logging
invalid request
com.thetransactioncompany.jsonrpc2.JSONRPC2ParseException: Invalid JSON
at com.thetransactioncompany.jsonrpc2.JSONRPC2Parser.parseJSONObject(JSO
NRPC2Parser.java:201
Is there a way for debug it or check what I am sending to the server?