axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecapilla....@soluziona.com
Subject DataHandler with Axis2
Date Tue, 13 Feb 2007 10:00:24 GMT

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 de 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.


Thanks in advance!
Esther



Cuide el medio ambiente, no imprima este correo si no es necesario.
************************* AVISO LEGAL *************************
Este mensaje y sus documentos anexos son privados y confidenciales y estan dirigidos exclusivamente
a sus
destinatarios. Si por error, ha recibido este mensaje y no se encuentra entre los destinatarios,
por favor, no use,
informe, distribuya, imprima o copie su contenido por ningun medio. Le rogamos lo comunique
al remitente y borre 
todo su contenido.
La empresa no asume ningun tipo de responsabilidad legal por el contenido de este mensaje.
Cualquier opinion 
manifestada en el pertenece solo al autor y no representa necesariamente la opinion de la
compañía salvo que 
expresamente se especifique lo contrario.

Please do not print this message to preserve environment.
************************* DISCLAIMER **************************
This message and its attached files may contain confidential and/or privileged information.
If you are not the addressee
or authorized to receive this for the addressee, you must not use, copy, disclose, or take
any action based on this message
or any other information herein. If you have received this message in error, please notify
the sender immediately by reply
e-mail and delete this message.
The company does not assume any legal responsability for the contents of this message. Any
opinion contained in it belongs
exclusively to its author and does not necessarily represent the company's opinion unless
it is specifically expressed on the
contrary.

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message