Package org.gsm.oneapi.responsebean.mms

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


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

      try {
        logger.debug("endpoint="+endPoints.getQueryMMSDeliveryEndpoint());
        String endpoint=endPoints.getQueryMMSDeliveryEndpoint().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=mmsSendDeliveryStatusProcessor.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

TOP

Related Classes of org.gsm.oneapi.responsebean.mms.MMSSendDeliveryStatusResponse

Copyright © 2018 www.massapicom. 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.