use of org.apache.cxf.binding.corba.wsdl.ArgType in project cxf by apache.
the class WSDLToIDLAction method createIdlOperation.
public void createIdlOperation(org.apache.cxf.binding.corba.wsdl.OperationType opType, String name, boolean isOneway) throws Exception {
IdlOperation idlOp = IdlOperation.create(intf, opType.getName(), isOneway);
intf.holdForScope(idlOp);
ArgType crt = opType.getReturn();
if (crt != null) {
IdlType rt = findType(crt.getIdltype());
idlOp.addReturnType(rt);
}
for (ParamType arg : opType.getParam()) {
IdlType type = findType(arg.getIdltype());
String mode = arg.getMode().value();
IdlParam param = IdlParam.create(idlOp, arg.getName(), type, mode);
idlOp.addParameter(param);
}
for (RaisesType rs : opType.getRaises()) {
IdlType type = findType(rs.getException());
if (type instanceof IdlException) {
idlOp.addException((IdlException) type);
} else {
String msgStr = type.fullName() + " is not a type.";
org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message(msgStr, LOG);
throw new Exception(msg.toString());
}
}
root.flush();
intf.promoteHeldToScope();
}
use of org.apache.cxf.binding.corba.wsdl.ArgType in project cxf by apache.
the class WSDLToIDLAction method createIdlAttribute.
public void createIdlAttribute(org.apache.cxf.binding.corba.wsdl.OperationType opType, String name) throws Exception {
String attrNm = name.substring(5, name.length());
IdlAttribute attr;
IdlDefn idlDef = intf.lookup(attrNm);
if (idlDef == null) {
if (name.startsWith("_get_")) {
ArgType t = opType.getReturn();
attr = IdlAttribute.create(intf, attrNm, findType(t.getIdltype()), true);
} else {
ParamType arg = opType.getParam().iterator().next();
attr = IdlAttribute.create(intf, attrNm, findType(arg.getIdltype()), false);
}
intf.addAttribute(attr);
} else {
attr = (IdlAttribute) idlDef;
if (attr.readonly() && name.startsWith("_set_")) {
attr.setReadonly(false);
}
}
}
use of org.apache.cxf.binding.corba.wsdl.ArgType in project cxf by apache.
the class WSDLToCorbaBinding method addCorbaOperationExtElement.
private void addCorbaOperationExtElement(BindingOperation bo, Operation op) throws Exception {
final OperationType operationType;
try {
operationType = (OperationType) extReg.createExtension(BindingOperation.class, CorbaConstants.NE_CORBA_OPERATION);
} catch (WSDLException wse) {
LOG.log(Level.SEVERE, "Failed to create a Binding Operation extension", wse);
throw new Exception(LOG.toString(), wse);
}
operationType.setName(op.getName());
List<ParamType> params = new ArrayList<>();
List<ArgType> returns = new ArrayList<>();
wsdlParameter.processParameters(this, op, def, xmlSchemaList, params, returns, true);
for (ParamType paramtype : params) {
operationType.getParam().add(paramtype);
}
for (ArgType retType : returns) {
operationType.setReturn(retType);
}
Collection<Fault> faults = CastUtils.cast(op.getFaults().values());
for (Fault fault : faults) {
RaisesType raisestype = new RaisesType();
CorbaType extype = convertFaultToCorbaType(xmlSchemaType, fault);
if (extype != null) {
raisestype.setException(helper.createQNameCorbaNamespace(extype.getName()));
operationType.getRaises().add(raisestype);
}
}
bo.addExtensibilityElement((ExtensibilityElement) operationType);
}
use of org.apache.cxf.binding.corba.wsdl.ArgType in project cxf by apache.
the class OperationVisitor method addCorbaReturn.
private void addCorbaReturn(CorbaTypeImpl corbaType, Scope fqName, String partName) {
ArgType param = new ArgType();
param.setName(partName);
if (corbaType != null) {
param.setIdltype(corbaType.getQName());
} else {
wsdlVisitor.getDeferredActions().add(fqName, new OperationDeferredAction(param));
}
corbaOperation.setReturn(param);
}
use of org.apache.cxf.binding.corba.wsdl.ArgType in project cxf by apache.
the class AttributeVisitor method generateCorbaReturnParam.
private ArgType generateCorbaReturnParam(AST type) {
ArgType param = new ArgType();
param.setName(RETURN_PARAM_NAME);
ParamTypeSpecVisitor visitor = new ParamTypeSpecVisitor(getScope(), definition, schema, wsdlVisitor);
visitor.visit(type);
CorbaTypeImpl corbaType = visitor.getCorbaType();
if (corbaType != null) {
param.setIdltype(corbaType.getQName());
} else {
wsdlVisitor.getDeferredActions().add(visitor.getFullyQualifiedName(), new AttributeDeferredAction(param));
}
return param;
}
Aggregations