}
public void buildRequestResult(CorbaMessage msg) {
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 = CorbaAnyHelper.createAny(orb);
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) {
arguments[i].getObject().setIntoAny(list.item(i).value(),
arguments[i], true);
}
}
}
CorbaStreamable resultValue = msg.getStreamableReturn();
if (resultValue != null) {
Any resultAny = CorbaAnyHelper.createAny(orb);
resultValue.getObject().setIntoAny(resultAny, resultValue, true);
request.set_result(resultAny);
}
}
}
} catch (java.lang.Exception ex) {