* OMElements/Attributes, we need to actually serialize the OM structures
* (at least in some cases.)
*/
public synchronized void writeExternal(java.io.ObjectOutput o)
throws IOException {
SafeObjectOutputStream out = SafeObjectOutputStream.install(o);
// revision ID
out.writeInt(revisionID);
// Correlation ID
String logCorrelationIDString = getLogCorrelationIDString();
// String object id
out.writeObject(logCorrelationIDString);
// Write out the content as xml
out.writeUTF("start xml"); // write marker
OMElement om =
EndpointReferenceHelper.toOM(OMAbstractFactory.getOMFactory(),
this,
new QName("urn:axis2", "omepr", "ser"),
AddressingConstants.Final.WSA_NAMESPACE);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
om.serialize(baos);
} catch (Exception e) {
IOException ioe = new IOException("Unable to serialize the EndpointReference with logCorrelationID ["
+logCorrelationIDString+"]");
ioe.initCause(e);
if (log.isDebugEnabled()) {
log.debug("writeObject(): Unable to serialize the EPR with logCorrelationID ["
+logCorrelationIDString+"] original error ["+e.getClass().getName()
+"] message ["+e.getMessage()+"]",e);
}
throw ioe;
}
out.writeInt(baos.size());
out.write(baos.toByteArray());
out.writeUTF("end xml"); // write marker
if (log.isDebugEnabled()) {
byte[] buffer = baos.toByteArray();
String content = new String(buffer);