public static String extractSessionIDFromGetSessionId(String jsonObject) throws ParseException {
String methodName = "extractSessionIDFromGetSessionId";
LOGGER.debug(CLASS_NAME + "/" + methodName + "; jsonObject = " + jsonObject);
System.out.println(CLASS_NAME + "/" + methodName + "; jsonObject = " + jsonObject);
JSONParser parser = new JSONParser();
String sessionId = "";
System.out.println("JSON object is :" + jsonObject);
LOGGER.debug("JSON object is :" + jsonObject);
Object obj = parser.parse(jsonObject);
JSONObject jo = (JSONObject) obj;
sessionId = jo.get("sessionId").toString();
System.out.println("SessionId is : " + sessionId);
System.out.println("Exiting from the method : " + methodName);
LOGGER.debug("Exiting from the method : " + methodName);
return sessionId;
}
NOTE: JSON Jar is required
No comments:
Post a Comment