if (checkRequestParameters(response, rules)) {
resourceURL=getRequestHostnameAndContext(request)+request.getServletPath()+"/1/messaging/outbound/subscriptions/sub789";
DeliveryReceiptSubscription receiptSubscription=new DeliveryReceiptSubscription();
receiptSubscription.setResourceURL(resourceURL);
DeliveryReceiptSubscription.CallbackReference callbackReference=new DeliveryReceiptSubscription.CallbackReference();
callbackReference.setNotifyURL(notifyURL);
callbackReference.setCallbackData(callbackData);
receiptSubscription.setCallbackReference(callbackReference);
ObjectMapper mapper=new ObjectMapper();
String jsonResponse="{\"deliveryReceiptSubscription\":"+mapper.writeValueAsString(receiptSubscription)+"}";