}
public void handleMessage(Message msg) {
CorbaMessage message = (CorbaMessage)msg;
try {
CorbaStreamable exStreamable = message.getStreamableException();
if (exStreamable != null) {
EventDataReader reader = (EventDataReader) ContextUtils.getDataReader(message);
BindingOperationInfo bopInfo = message.getExchange().get(BindingOperationInfo.class);
OperationType opType = bopInfo.getExtensor(OperationType.class);
OperationInfo opInfo = bopInfo.getOperationInfo();
List<CorbaTypeMap> typeMaps = new ArrayList<CorbaTypeMap>();
ServiceInfo service = message.getExchange().get(ServiceInfo.class);
List<TypeMappingType> corbaTypes =
service.getDescription().getExtensors(TypeMappingType.class);
if (corbaTypes != null) {
corbaStaxObject.setTypeMaps(typeMaps);
corbaStaxObject.setServiceInfo(service);
}
org.omg.CORBA.ORB orb = (org.omg.CORBA.ORB) message.get(CorbaConstants.ORB);
if (orb == null) {
orb = (org.omg.CORBA.ORB) message.getExchange().get(org.omg.CORBA.ORB.class);
}
corbaStaxObject.setOrb(orb);
QName elName = new QName("", exStreamable.getName());
XMLInputFactory inputFactory = getXMLInputFactory();
XMLOutputFactory outputFactory = getXMLOutputFactory();
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
corbaStaxObject.writeObjectToStax(exStreamable.getObject(),
evtWriter,
XMLEventFactory.newInstance());
evtWriter.flush();
ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);