Implement a general rpc call.