@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;
}