Search in sources :

Example 1 with IdlOperation

use of org.apache.cxf.tools.corba.common.idltypes.IdlOperation 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) 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)

Aggregations

ArgType (org.apache.cxf.binding.corba.wsdl.ArgType)1 ParamType (org.apache.cxf.binding.corba.wsdl.ParamType)1 RaisesType (org.apache.cxf.binding.corba.wsdl.RaisesType)1 IdlException (org.apache.cxf.tools.corba.common.idltypes.IdlException)1 IdlOperation (org.apache.cxf.tools.corba.common.idltypes.IdlOperation)1 IdlParam (org.apache.cxf.tools.corba.common.idltypes.IdlParam)1 IdlString (org.apache.cxf.tools.corba.common.idltypes.IdlString)1 IdlType (org.apache.cxf.tools.corba.common.idltypes.IdlType)1