Search in sources :

Example 6 with ArgType

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();
}
Also used : ArgType(org.apache.cxf.binding.corba.wsdl.ArgType) IdlException(org.apache.cxf.tools.corba.common.idltypes.IdlException) IdlString(org.apache.cxf.tools.corba.common.idltypes.IdlString) IdlType(org.apache.cxf.tools.corba.common.idltypes.IdlType) ParamType(org.apache.cxf.binding.corba.wsdl.ParamType) ToolException(org.apache.cxf.tools.common.ToolException) IdlException(org.apache.cxf.tools.corba.common.idltypes.IdlException) IdlOperation(org.apache.cxf.tools.corba.common.idltypes.IdlOperation) RaisesType(org.apache.cxf.binding.corba.wsdl.RaisesType) IdlParam(org.apache.cxf.tools.corba.common.idltypes.IdlParam)

Example 7 with ArgType

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);
        }
    }
}
Also used : ArgType(org.apache.cxf.binding.corba.wsdl.ArgType) IdlDefn(org.apache.cxf.tools.corba.common.idltypes.IdlDefn) IdlAttribute(org.apache.cxf.tools.corba.common.idltypes.IdlAttribute) IdlString(org.apache.cxf.tools.corba.common.idltypes.IdlString) ParamType(org.apache.cxf.binding.corba.wsdl.ParamType)

Example 8 with ArgType

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);
}
Also used : ArgType(org.apache.cxf.binding.corba.wsdl.ArgType) RaisesType(org.apache.cxf.binding.corba.wsdl.RaisesType) CorbaType(org.apache.cxf.binding.corba.wsdl.CorbaType) WSDLException(javax.wsdl.WSDLException) ArrayList(java.util.ArrayList) Fault(javax.wsdl.Fault) BindingFault(javax.wsdl.BindingFault) OperationType(org.apache.cxf.binding.corba.wsdl.OperationType) WSDLException(javax.wsdl.WSDLException) ToolException(org.apache.cxf.tools.common.ToolException) ParamType(org.apache.cxf.binding.corba.wsdl.ParamType)

Example 9 with ArgType

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);
}
Also used : ArgType(org.apache.cxf.binding.corba.wsdl.ArgType)

Example 10 with ArgType

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;
}
Also used : ArgType(org.apache.cxf.binding.corba.wsdl.ArgType) CorbaTypeImpl(org.apache.cxf.binding.corba.wsdl.CorbaTypeImpl)

Aggregations

ArgType (org.apache.cxf.binding.corba.wsdl.ArgType)12 ParamType (org.apache.cxf.binding.corba.wsdl.ParamType)8 OperationType (org.apache.cxf.binding.corba.wsdl.OperationType)6 CorbaStreamWriter (org.apache.cxf.binding.corba.runtime.CorbaStreamWriter)4 ArrayList (java.util.ArrayList)3 QName (javax.xml.namespace.QName)3 XMLStreamWriter (javax.xml.stream.XMLStreamWriter)2 CorbaStreamable (org.apache.cxf.binding.corba.CorbaStreamable)2 CorbaObjectHandler (org.apache.cxf.binding.corba.types.CorbaObjectHandler)2 ModeType (org.apache.cxf.binding.corba.wsdl.ModeType)2 RaisesType (org.apache.cxf.binding.corba.wsdl.RaisesType)2 BindingOperationInfo (org.apache.cxf.service.model.BindingOperationInfo)2 MessageInfo (org.apache.cxf.service.model.MessageInfo)2 OperationInfo (org.apache.cxf.service.model.OperationInfo)2 ToolException (org.apache.cxf.tools.common.ToolException)2 IdlString (org.apache.cxf.tools.corba.common.idltypes.IdlString)2 BindingFault (javax.wsdl.BindingFault)1 BindingOperation (javax.wsdl.BindingOperation)1 Fault (javax.wsdl.Fault)1 Message (javax.wsdl.Message)1