axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thilina Gunarathne <cset...@gmail.com>
Subject [Axis2] Introducing OMOutput
Date Fri, 24 Jun 2005 04:54:02 GMT
Hi all,
 We are using OMText (will be renamed to OMCharacters) class to handle both 
optimised and un-optimised data. So this class may contain some binary data 
as well. This will create a problem as the serialiser which writes using an 
StAXWriter can not handle binary. 
 So I will be introducing a new OMOutput class to handle all these. This 
will basically wrap the StAXWriter for XML outputting and will handle binary 
output of data.
  Usage of OMOutput is as follows. One can instantiate a OMOutput by giving 
an OutputStream and a boolean flag which will say whether the serialization 
is MTOM optimised or not. In the use cases which do'nt use MTOM optimisation 
it'll be like 
 OMOutput omOutput = new OMOutput(outStream,false);
In optimised case 
 OMOutput omOutput = new OMOutput(outstream,true);
 Then we can get the XMLStreamWriter by calling the methode 
getXmlStreamWriter();
eg; 
 XMLStreamWriter writer = omOutput.getXmlStreamWriter();
 For backward compatibility we even include a constructor which takes in an 
XMLStreamWriter. But the novice users are encourage not to use this, but to 
use above mentioned constructors, which takes in OutputStream. 
 So the typical XML outputting will be as follows.
  OMOutput out = new OMOutput(outputStream,false);
envelope.serialize(out);
out.flush();
 Thanks & Regards,
~Thilina
 

"May the SourcE be with u"

Mime
View raw message