use of org.apache.cxf.binding.corba.wsdl.ArgType in project cxf by apache.
the class CorbaStreamOutEndingInterceptor method handleInBoundMessage.
private void handleInBoundMessage(CorbaMessage message, BindingOperationInfo boi) {
OperationInfo opInfo = boi.getOperationInfo();
OperationType opType = boi.getExtensor(OperationType.class);
List<ParamType> paramTypes = opType.getParam();
MessageInfo msgInInfo = opInfo.getInput();
String wrapNSUri = null;
boolean wrap = false;
if (boi.isUnwrappedCapable()) {
wrap = true;
if (msgInInfo != null) {
wrapNSUri = getWrappedParamNamespace(msgInInfo);
if (!CorbaUtils.isElementFormQualified(service, wrapNSUri)) {
wrapNSUri = "";
}
}
}
CorbaStreamWriter writer = (CorbaStreamWriter) message.getContent(XMLStreamWriter.class);
CorbaObjectHandler[] objs = writer.getCorbaObjects();
int count = 0;
int msgIndex = 0;
ArgType returnParam = opType.getReturn();
if (returnParam != null) {
CorbaObjectHandler obj = objs[count++];
QName retName = obj.getName();
CorbaStreamable streamable = message.createStreamableObject(obj, retName);
message.setStreamableReturn(streamable);
}
for (Iterator<ParamType> iter = paramTypes.iterator(); iter.hasNext(); ) {
ParamType param = iter.next();
QName idlType = param.getIdltype();
QName paramName;
final CorbaObjectHandler obj;
if (param.getMode().equals(ModeType.IN)) {
if (wrap) {
paramName = new QName(wrapNSUri, param.getName());
} else {
paramName = getMessageParamQName(msgInInfo, param.getName(), msgIndex);
}
obj = CorbaHandlerUtils.initializeObjectHandler(orb, paramName, idlType, typeMap, service);
msgIndex++;
} else {
obj = objs[count++];
paramName = obj.getName();
}
CorbaStreamable streamable = message.createStreamableObject(obj, paramName);
ModeType paramMode = param.getMode();
if ("in".equals(paramMode.value())) {
streamable.setMode(org.omg.CORBA.ARG_IN.value);
} else if ("inout".equals(paramMode.value())) {
streamable.setMode(org.omg.CORBA.ARG_INOUT.value);
} else if ("out".equals(paramMode.value())) {
streamable.setMode(org.omg.CORBA.ARG_OUT.value);
}
message.addStreamableArgument(streamable);
}
}
use of org.apache.cxf.binding.corba.wsdl.ArgType in project cxf by apache.
the class CorbaStreamWriter method setCurrentTypeListener.
protected void setCurrentTypeListener(QName name) throws XMLStreamException {
ArgType param = params.get(paramCounter);
QName idlType = param.getIdltype();
if (!skipWrap || (name.getLocalPart().equals(param.getName()))) {
currentTypeListener = CorbaHandlerUtils.getTypeListener(name, idlType, typeMap, orb, serviceInfo);
currentTypeListener.setNamespaceContext(ctx);
listeners[paramCounter] = currentTypeListener;
paramCounter++;
} else {
throw new XMLStreamException("Expected element not found: " + param.getName() + " (Found " + name.getLocalPart() + ")");
}
}
Aggregations