Exchange exg = msg.getExchange();
ServerRequest request = exg.get(ServerRequest.class);
try {
if (!exg.isOneWay()) {
CorbaMessage inMsg = (CorbaMessage)msg.getExchange().getInMessage();
NVList list = inMsg.getList();
if (msg.getStreamableException() != null) {
Any exAny = orb.create_any();
CorbaStreamable exception = msg.getStreamableException();
exAny.insert_Streamable(exception);
request.set_exception(exAny);
if (msg.getExchange() != null) {
msg.getExchange().setOutFaultMessage(msg);
}
} else {
CorbaStreamable[] arguments = msg.getStreamableArguments();
if (arguments != null) {
for (int i = 0; i < arguments.length; ++i) {
if (list.item(i).flags() != org.omg.CORBA.ARG_IN.value) {
list.item(i).value().insert_Streamable(arguments[i]);
}
}
}
CorbaStreamable resultValue = msg.getStreamableReturn();