final String conversationId = req.getHeader(MchoiceUssdMessage.CONVERSATION);
ussdAoRequestMessage.setConversationId(conversationId);
System.out.println("New USSD Message Received [" + ussdAoRequestMessage + "]");
final MchoiceUssdResponse mchoiceUssdResponse = new MchoiceUssdResponse();
try {
validateAndSetAuthentication(req, mchoiceUssdResponse);
validateAndSetAddress(ussdAoRequestMessage, mchoiceUssdResponse);
validateAndSetConversationId(ussdAoRequestMessage, mchoiceUssdResponse);
} catch (Exception e) {
System.out.println("Received USSD Message Failed : "+ e );
System.out.println(ussdAoRequestMessage);
}
mchoiceUssdResponse.setCorrelationId(String.valueOf(Math.random()));
return gson.toJson(mchoiceUssdResponse);
}