public ImageDepot sendImage(ImageDepot input) {
TestLogger.logger.debug("MtomSampleMTOMDisableService [new sendImage request received]");
DataHandler data = input.getImageData();
TestLogger.logger.debug("[contentType] " + data.getContentType());
ImageDepot output = (new ObjectFactory()).createImageDepot();
Image image = null;
resetAttachmentUnmarshallingMonitor();
try {
InputStream stream = (InputStream) data.getContent();
image = ImageIO.read(stream);
DataSource imageDS = new DataSourceImpl("image/jpeg", "test.jpg", image);
DataHandler handler = new DataHandler(imageDS);
output.setImageData(handler);
}
catch (Exception e) {
throw new WebServiceException(e);
}
return output;