Search in sources :

Example 1 with IdlException

use of org.apache.cxf.tools.corba.common.idltypes.IdlException 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 2 with IdlException

use of org.apache.cxf.tools.corba.common.idltypes.IdlException in project cxf by apache.

the class WSDLToIDLAction method createIdlException.

private IdlType createIdlException(org.apache.cxf.binding.corba.wsdl.Exception e, IdlScopeBase scope, String local) throws Exception {
    final IdlType result;
    Object obj = scope.lookup(local);
    if (obj != null && (obj instanceof IdlException)) {
        result = (IdlType) obj;
    } else {
        IdlException exc = IdlException.create(scope, local);
        scope.holdForScope(exc);
        for (MemberType m : e.getMember()) {
            QName qname = m.getIdltype();
            IdlType type = findType(qname);
            exc.addToScope(IdlField.create(exc, m.getName(), type));
        }
        result = exc;
        scope.promoteHeldToScope();
    }
    return result;
}
Also used : IdlException(org.apache.cxf.tools.corba.common.idltypes.IdlException) MemberType(org.apache.cxf.binding.corba.wsdl.MemberType) QName(javax.xml.namespace.QName) IdlType(org.apache.cxf.tools.corba.common.idltypes.IdlType)

Aggregations

IdlException (org.apache.cxf.tools.corba.common.idltypes.IdlException)2 IdlType (org.apache.cxf.tools.corba.common.idltypes.IdlType)2 QName (javax.xml.namespace.QName)1 ArgType (org.apache.cxf.binding.corba.wsdl.ArgType)1 MemberType (org.apache.cxf.binding.corba.wsdl.MemberType)1 ParamType (org.apache.cxf.binding.corba.wsdl.ParamType)1 RaisesType (org.apache.cxf.binding.corba.wsdl.RaisesType)1 ToolException (org.apache.cxf.tools.common.ToolException)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