Examples of MMSMessageReceiptSubscriptionResponse


Examples of org.gsm.oneapi.responsebean.mms.MMSMessageReceiptSubscriptionResponse

  @param callbackData (optional) is a function name or other data that you would like included when the POST is sent to your application

  @see MMSMessageReceiptSubscriptionResponse
  */
  public MMSMessageReceiptSubscriptionResponse subscribeToReceiptNotifications(String destinationAddress, String notifyURL, String criteria, String notificationFormat, String clientCorrelator, String callbackData) {
    MMSMessageReceiptSubscriptionResponse response=new MMSMessageReceiptSubscriptionResponse();

    if (destinationAddress!=null && notifyURL!=null) {
      FormParameters formParameters=new FormParameters();
      formParameters.put("destinationAddress", destinationAddress);
      formParameters.put("notifyURL", notifyURL);
      formParameters.put("criteria", criteria);
      formParameters.put("notificationFormat", notificationFormat);
      formParameters.put("clientCorrelator", clientCorrelator);
      formParameters.put("callbackData", callbackData);
     
        int responseCode=0;
          String contentType = null;
     
      try {
        String endpoint=endPoints.getMMSReceiptSubscriptionsEndpoint();
       
        if (dumpRequestAndResponse) JSONRequest.dumpRequestVariables(endpoint, authorisationHeader, formParameters);
 
        HttpURLConnection con = JSONRequest.setupConnection(endpoint, authorisationHeader);
            con.setDoOutput(true);
            OutputStreamWriter out = new OutputStreamWriter(con.getOutputStream());
           
            String requestBody=JSONRequest.formEncodeParams(formParameters);
            out.write(requestBody);
            out.close();
 
            responseCode=con.getResponseCode();
              contentType = con.getContentType();
           
              response=mmsMessageReceiptSubscriptionProcessor.getResponse(con, OneAPIServlet.CREATED);
      } catch (Exception e) {
        response.setHTTPResponseCode(responseCode);
        response.setContentType(contentType);
       
        response.setRequestError(new RequestError(RequestError.SERVICEEXCEPTION, "SVCJAVA", e.getMessage(), e.getClass().getName()));
       
        logger.error("Exception "+e.getMessage()+" "+e.getLocalizedMessage());
      }
    }
    return response;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.