ContextList ctxList = orb.create_context_list();
Context ctx = orb.get_default_context();
CorbaStreamable retVal = mc.getMessage().getStreamableReturn();
NamedValue ret = null;
if (retVal != null) {
Any returnAny = orb.create_any();
returnAny.insert_Streamable(retVal);
ret = orb.create_named_value(retVal.getName(), returnAny, org.omg.CORBA.ARG_OUT.value);
} else {
// TODO: REVISIT: for some reason, the yoko ORB does not like to have a null NamedValue
// return value. Create this 'empty' one if a void return type is used.
ret = orb.create_named_value("return", orb.create_any(), org.omg.CORBA.ARG_OUT.value);
}
// Get the typecodes for the exceptions this operation can throw. These are defined in the
// operation definition from WSDL.
ExceptionList exList = orb.create_exception_list();
OperationType operation = CorbaUtils.getCorbaOperationType(callback.getOperationName(),
bus,
endpointRef);
if (operation == null) {
throw new CorbaBindingException("Unable to obtain operation definition");
}
Map<TypeCode, RaisesType> exceptions = getOperationExceptions(operation);
Object[] tcs = exceptions.keySet().toArray();
for (int i = 0; i < exceptions.size(); ++i) {
exList.add((TypeCode) tcs[i]);
}
Request request =
target._create_request(ctx,
(String)objectCtx.get(ObjectMessageContext.WSDL_OPERATION),
list,
ret,
exList,
ctxList);
request.invoke();
mc.put(ObjectMessageContext.MESSAGE_INPUT, Boolean.FALSE);
java.lang.Exception ex = request.env().exception();
if (ex == null) {
if (retVal != null) {
message.setStreamableReturnValue(retVal.getObject());
}
for (int i = 0; i < list.count(); ++i) {
NamedValue arg = (NamedValue) list.item(i);
if (arg.flags() != org.omg.CORBA.ARG_IN.value) {
CorbaStreamable streamable = (CorbaStreamable)arg.value().extract_Streamable();
message.setStreamableArgumentValue(streamable.getObject(), i);
}
}
corbaBinding.unmarshal(mc, objectCtx, callback);
} else if (ex instanceof UnknownUserException) {