I'm building Java servlet that responds to SMS messages. Pure text response works just fine. When I'm trying to include media in response I see image icon (not an actual image I refer by URL) which is indefinitely downloading on phone screen. What is wrong? Below is the code:
private void sendResponse(HttpServletResponse response, String msg){
String media="<Media>"+mediaURL+"</Media>";
String body="<Body>"+msg+"</Body>";
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Message>"+body + "</Message></Response>";
try {
log.debug("xml="+xml);
response.setContentType("application/xml;charset=UTF-8");
response.getWriter().write(xml);
} catch (Exception e) {
// TODO Auto-generated catch block
log.error(ExceptionUtils.getFullStackTrace(e));
}
}