Search in sources :

Example 16 with IdlType

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

the class WSDLToIDLAction method findIdlType.

private IdlType findIdlType(String local, QName ntype, CorbaType corbatypeImpl) throws Exception {
    IdlType idlType = null;
    if (ntype.getNamespaceURI().equals(CorbaConstants.NU_WSDL_CORBA)) {
        try {
            idlType = createPrimitiveType(ntype, local);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    } else {
        if (CorbaUtils.isTimeBaseDef(local)) {
            root.addInclude("<omg/TimeBase.idl>");
        }
        String[] name = unscopeName(local);
        IdlDefn defn = root.lookup(name);
        if (defn != null) {
            if (defn instanceof IdlType) {
                return (IdlType) defn;
            }
            String msgStr = local + " is an incorrect idltype.";
            org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message(msgStr, LOG);
            throw new Exception(msg.toString());
        }
        try {
            idlType = createType(ntype, name, corbatypeImpl);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    return idlType;
}
Also used : IdlDefn(org.apache.cxf.tools.corba.common.idltypes.IdlDefn) IdlString(org.apache.cxf.tools.corba.common.idltypes.IdlString) IdlType(org.apache.cxf.tools.corba.common.idltypes.IdlType) IdlException(org.apache.cxf.tools.corba.common.idltypes.IdlException)

Example 17 with IdlType

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

the class WSDLToIDLAction method createInterface.

private IdlType createInterface(org.apache.cxf.binding.corba.wsdl.Object obj, IdlScopeBase scope, String local) throws Exception {
    IdlType result = null;
    QName bqname = obj.getBinding();
    Binding binding = def.getBinding(bqname);
    if (binding != null) {
        IdlDefn defn = scope.lookup(local);
        if (defn instanceof IdlInterface) {
            return (IdlInterface) defn;
        } else if (defn == null) {
            try {
                IdlInterface storedIntf = intf;
                intf = IdlInterface.create(scope, local);
                scope.holdForScope(intf);
                collectIdlDefns(binding);
                scope.promoteHeldToScope();
                result = intf;
                intf = storedIntf;
            } catch (Exception ex) {
                String msgStr = "Interface type " + intf.fullName() + " not found.";
                org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message(msgStr, LOG);
                throw new Exception(msg.toString());
            }
        }
    }
    return result;
}
Also used : Binding(javax.wsdl.Binding) QName(javax.xml.namespace.QName) IdlDefn(org.apache.cxf.tools.corba.common.idltypes.IdlDefn) IdlInterface(org.apache.cxf.tools.corba.common.idltypes.IdlInterface) IdlString(org.apache.cxf.tools.corba.common.idltypes.IdlString) IdlType(org.apache.cxf.tools.corba.common.idltypes.IdlType) IdlException(org.apache.cxf.tools.corba.common.idltypes.IdlException)

Aggregations

IdlType (org.apache.cxf.tools.corba.common.idltypes.IdlType)17 IdlString (org.apache.cxf.tools.corba.common.idltypes.IdlString)8 IdlException (org.apache.cxf.tools.corba.common.idltypes.IdlException)6 QName (javax.xml.namespace.QName)5 IdlDefn (org.apache.cxf.tools.corba.common.idltypes.IdlDefn)4 IdlSequence (org.apache.cxf.tools.corba.common.idltypes.IdlSequence)3 MemberType (org.apache.cxf.binding.corba.wsdl.MemberType)2 IdlStruct (org.apache.cxf.tools.corba.common.idltypes.IdlStruct)2 IdlUnion (org.apache.cxf.tools.corba.common.idltypes.IdlUnion)2 Binding (javax.wsdl.Binding)1 Alias (org.apache.cxf.binding.corba.wsdl.Alias)1 Anonarray (org.apache.cxf.binding.corba.wsdl.Anonarray)1 Anonfixed (org.apache.cxf.binding.corba.wsdl.Anonfixed)1 Anonsequence (org.apache.cxf.binding.corba.wsdl.Anonsequence)1 Anonstring (org.apache.cxf.binding.corba.wsdl.Anonstring)1 ArgType (org.apache.cxf.binding.corba.wsdl.ArgType)1 Array (org.apache.cxf.binding.corba.wsdl.Array)1 CaseType (org.apache.cxf.binding.corba.wsdl.CaseType)1 Const (org.apache.cxf.binding.corba.wsdl.Const)1 CorbaType (org.apache.cxf.binding.corba.wsdl.CorbaType)1