.getSOAPPartInputStream())));
builder = new MTOMStAXSOAPModelBuilder(reader, mimeHelper, null);
OMElement root = builder.getDocumentElement();
OMElement body = (OMElement) root.getFirstOMChild();
OMElement data = (OMElement) body.getFirstOMChild();
OMText blob = (OMText) data.getFirstOMChild();
/*
* Following is the procedure the user has to follow to read objects in
* OBBlob User has to know the object type & whether it is serializable.
* If it is not he has to use a Custom Defined DataSource to get the
* Object.
*/
DataHandler actualDH;
actualDH = (DataHandler)blob.getDataHandler();
Image actualObject = new ImageIO().loadImage(actualDH.getDataSource()
.getInputStream());
FileOutputStream imageOutStream = new FileOutputStream(
new File(imageOutFileName));
new ImageIO().saveImage("image/jpeg", actualObject, imageOutStream);