use of org.omg.CORBA.UnknownUserException in project cxf by apache.
the class CorbaConduit method buildRequest.
public void buildRequest(CorbaMessage message, OperationType opType) throws Exception {
ServiceInfo service = message.getExchange().getEndpoint().getEndpointInfo().getService();
NVList nvlist = getArguments(message);
NamedValue ret = getReturn(message);
Map<TypeCode, RaisesType> exceptions = getOperationExceptions(opType, typeMap);
ExceptionList exList = getExceptionList(exceptions, message, opType);
Request request = getRequest(message, opType.getName(), nvlist, ret, exList);
if (request == null) {
throw new CorbaBindingException("Couldn't build the corba request");
}
Exception ex = null;
try {
request.invoke();
ex = request.env().exception();
} catch (SystemException sysex) {
ex = sysex;
}
if (ex != null) {
if (ex instanceof SystemException) {
message.setContent(Exception.class, new Fault(ex));
message.setSystemException((SystemException) ex);
return;
}
if (ex instanceof UnknownUserException) {
UnknownUserException userEx = (UnknownUserException) ex;
Any except = userEx.except;
RaisesType raises = exceptions.get(except.type());
if (raises == null) {
throw new CorbaBindingException("Couldn't find the exception type code to unmarshall");
}
QName elName = new QName("", raises.getException().getLocalPart());
CorbaObjectHandler handler = CorbaHandlerUtils.initializeObjectHandler(orb, elName, raises.getException(), typeMap, service);
CorbaStreamable exStreamable = message.createStreamableObject(handler, elName);
exStreamable._read(except.create_input_stream());
message.setStreamableException(exStreamable);
message.setContent(Exception.class, new Fault(userEx));
} else {
message.setContent(Exception.class, new Fault(ex));
}
}
}
Aggregations