Please check this code sample.
HttpEntity getResponseEntity = getResponse.getEntity();
String message = EntityUtils.toString(getResponseEntity,\"UTF-8\");
You can get values of json object like this without knowing key
Iterator<String> keys= object.keys();
while (keys.hasNext())
{
String keyValue = (String)keys.next();
String valueString = object.getString(keyValue);
}
This should work.
JSONObject object = new JSONObject(message);
String objectString = object.getString(object.names().get(0));
But it will only work if you sure that NextTransactionUrl
node exists. By the way, in this case, this node could have another name, it will still work.