File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes DataHandler with Axis2 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "DataHandler with Axis2" Watch "DataHandler with Axis2" New topic
Author

DataHandler with Axis2

Esther Capilla
Greenhorn

Joined: Jan 25, 2007
Posts: 12
Hi all,
I'm trying to use DataHandler with axis2, I've seen some example and I use the following code...
To build OMElement with DataHandler:
DataHandler dataHandler;
FileDataSource dataSource = new FileDataSource(archivo);
dataHandler = new DataHandler(dataSource);
OMText textData = fac.createOMText(dataHandler, true);
file.addChild(textData);

And to obtain the DataHandler in the Client:
file = elementhijo.getFirstElement();
OMText binaryNode = (OMText) file.getFirstOMChild();
DataHandler dataHandler;
dataHandler = (DataHandler) binaryNode.getDataHandler();

To obtain the Element file, I verify that it is the correct element, but I obtain a Class Cast Exception in the line "OMText binaryNode = (OMText) file.getFirstOMChild();" to try convert a OMElement to OMText.

can help me somebody?
Thanks in advance!
Esther
Esther Capilla
Greenhorn

Joined: Jan 25, 2007
Posts: 12
I am looking for the efficient way to send archives, and I'm tryin that way (Datahandler), but someone know other way to send archives...
Can help me somebody?

Thanks!
Esther
 
jQuery in Action, 2nd edition
 
subject: DataHandler with Axis2
 
Similar Threads
AXIS2 mustUnderstand fault
Uploading a document to SharePoint using Java and Axis2
AXIS2 Axis fault SOAPEnvelope must contain a body element
servlets and xml
MTOM content transfer - Axis2