//Create a DataHandler with the String DataSource object
DataHandler dataHandler = new DataHandler(imageDS);
//Store the data handler in ImageDepot bean
ImageDepot imageDepot = new ObjectFactory().createImageDepot();
imageDepot.setImageData(dataHandler);
SendImage request = new ObjectFactory().createSendImage();
request.setInput(imageDepot);
//Create the necessary JAXBContext
JAXBContext jbc = JAXBContext.newInstance("org.test.mtom");