Examples of SMSSendDeliveryStatusResponse


Examples of org.gsm.oneapi.responsebean.sms.SMSSendDeliveryStatusResponse

  @param requestId (mandatory) contains the requestId returned from a previous call to the sendSMS function
      
  @see SMSSendDeliveryStatusResponse
  */
  public SMSSendDeliveryStatusResponse queryDeliveryStatus(String senderAddress, String requestId) {
    SMSSendDeliveryStatusResponse response=new SMSSendDeliveryStatusResponse();
   
    if (senderAddress!=null && requestId!=null) {
     
        int responseCode=0;
          String contentType = null;

      try {
        logger.debug("endpoint="+endPoints.getQuerySMSDeliveryEndpoint());
        String endpoint=endPoints.getQuerySMSDeliveryEndpoint().replaceAll("\\{senderAddress\\}", URLEncoder.encode(senderAddress, "utf-8")).replaceAll("\\{requestId\\}", URLEncoder.encode(requestId, "utf-8"));
       
        if (dumpRequestAndResponse) JSONRequest.dumpRequestVariables(endpoint, authorisationHeader, null);
       
        HttpURLConnection con = JSONRequest.setupConnection(endpoint, authorisationHeader);
 
            responseCode=con.getResponseCode();
              contentType = con.getContentType();
             
              response.setHTTPResponseCode(responseCode);
              response.setContentType(contentType);
           
              response=smsSendDeliveryStatusProcessor.getResponse(con, OneAPIServlet.OK);
      } catch (Exception e) {
        logger.error("Exception "+e.getMessage()+" "+e.getLocalizedMessage());
        e.printStackTrace();
        response.setHTTPResponseCode(responseCode);
        response.setContentType(contentType);
       
        response.setRequestError(new RequestError(RequestError.SERVICEEXCEPTION, "SVCJAVA", e.getMessage(), e.getClass().getName()));
      }
    }
    return response;
  }
View Full Code Here

Examples of org.gsm.oneapi.responsebean.sms.SMSSendDeliveryStatusResponse

      logger.debug("No response obtained");
    }
   
    logger.debug("Query delivery status using endpoint="+serviceEndpoints.getQuerySMSDeliveryEndpoint());
   
    SMSSendDeliveryStatusResponse deliveryStatus=me.queryDeliveryStatus("tel:987654", "ref2781398");
    if (deliveryStatus!=null) {
      logger.debug("SMSSendDeliveryStatusResponse="+deliveryStatus.toString());
    } else {
      logger.debug("No response obtained");
    }
   
    logger.debug("Register a delivery report receipt notification endpoint="+serviceEndpoints.getSMSDeliverySubscriptionsEndpoint());
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.