Package org.apache.cxf.binding.corba.wsdl

Examples of org.apache.cxf.binding.corba.wsdl.CorbaType


    }

    private MemberType processChoiceMember(XmlSchemaChoice choice, QName defaultName,
        QName schemaTypeName) throws Exception {

        CorbaType corbatype = processChoice(choice, defaultName, schemaTypeName);
        MemberType member = new MemberType();
        member.setName(corbatype.getQName().getLocalPart());
        member.setIdltype(corbatype.getQName());
        if (corbatype.isSetQualified() && corbatype.isQualified()) {
            member.setQualified(true);
        }
        return member;
    }
View Full Code Here


    }

    private MemberType processAllMember(XmlSchemaAll all, QName defaultName,
        QName schemaTypeName) throws Exception {

        CorbaType corbatype = processAllType(all, defaultName, schemaTypeName);
        MemberType member = new MemberType();
        member.setName(corbatype.getQName().getLocalPart());
        member.setIdltype(corbatype.getQName());
        if (corbatype.isSetQualified() && corbatype.isQualified()) {
            member.setQualified(true);
        }
        return member;
    }
View Full Code Here

        }

    }

    private void visitNewTypes(Scope newScope) {
        CorbaType nextCorbaType = null;
        XmlSchemaType nextSchemaType = null;

        CorbaType oldCorbaType = getCorbaType();

        QName newQname = new QName(getCorbaType().getQName().getNamespaceURI(), newScope.toString());

        if (oldCorbaType instanceof Alias) {
            // Alias
View Full Code Here

            ex.printStackTrace();
        }
    }

    private CorbaType getCorbaType(QName qname) throws Exception {   
        CorbaType corbaTypeImpl = null;

        try {
            TypeMappingType typeMappingType = getTypeMappingType();
            if (typeMappingType != null) {
                for (CorbaType corbaType : typeMappingType.getStructOrExceptionOrUnion()) {
View Full Code Here

    protected IdlType createType(QName idlType, String name[], CorbaType corbaType) throws Exception {
        if (idlType.getLocalPart().equals("CORBA.Object")) {
            return IdlInterface.create(null, "Object");
        }       

        CorbaType  corbaTypeImpl = corbaType;
        if (corbaTypeImpl == null) {
            corbaTypeImpl = getCorbaType(idlType);
        }
       
        if (corbaTypeImpl == null) {
            String msgStr = "Type " + idlType.getLocalPart() + " not found.";
            org.apache.cxf.common.i18n.Message msg =
                new org.apache.cxf.common.i18n.Message(msgStr, LOG);
            throw new Exception(msg.toString());               
        }
       
        IdlScopeBase scope = root;
        StringBuilder dotScopedName = new StringBuilder("");

        for (int i = 0; i < name.length - 1; ++i) {
            dotScopedName.append(name[i]);

            // If we have the name CORBA, we need to make sure we are not handling the CORBA.Object
            // name which is used for object references.  If so, we don't want to generate a module
            // since it is not a type we need to define in our IDL.  This only happens when the
            // name is "CORBA", we have a name array of length 2 and we are at the beginning of the
            // name array.
            if ("CORBA".equals(dotScopedName.toString())
                && name.length == 2 && i == 0
                && name[1].equals("Object")) {
                break;
            }
           
            IdlDefn idlDef = scope.lookup(name[i]);

            if (idlDef == null) {
                // Before creating module, check to see if a Corba type
                // represent this name aleady exists.
                // For example if type is a.b.c and we are about to create
                // module b,look to see if a.b
                // is an interface that needs to be processed
                QName qname = new QName(corbaTypeImpl.getType().getNamespaceURI(), dotScopedName.toString());

                // Check to see if CORBAType exists. If so, create type for it
                // otherwise
                // create module for this scope              
                CorbaType possibleCorbaType = getCorbaType(qname);

                if (possibleCorbaType != null) {
                    idlDef = findType(qname);                   
                }
View Full Code Here

        // Get the list of all corba types already defined and look for the provided
        // QName.  If we have defined this type, we don't need to add it to the typemap
        // again.
        List<CorbaType> allTypes = typeMap.getStructOrExceptionOrUnion();
        for (Iterator<CorbaType> iter = allTypes.iterator(); iter.hasNext();) {
            CorbaType impl = iter.next();
            if (impl.getQName().equals(objectReferenceName))  {
                return true;
            }
        }
        return false;
    }
View Full Code Here

        }

        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);
View Full Code Here

        }
    }

    private void addCorbaTypes(XmlSchema xmlSchemaTypes) throws Exception {
        Map<QName, XmlSchemaType> objs = xmlSchemaTypes.getSchemaTypes();
        CorbaType corbaTypeImpl = null;
        for (XmlSchemaType type : objs.values()) {
            boolean anonymous = WSDLTypes.isAnonymous(type.getName());
            corbaTypeImpl = helper.convertSchemaToCorbaType(type, type.getQName(), null,
                                                            null, anonymous);
            if (corbaTypeImpl != null
View Full Code Here

                    faultName = faultName + "Exception";
                }
                QName faultMsgName = helper.createQNameCorbaNamespace(faultName);
                corbaex.setName(faultName);
                corbaex.setQName(faultMsgName);
                CorbaType corbaTypeImpl =
                    helper.convertSchemaToCorbaType(schemaType, name, null, null, false);
                if (corbaTypeImpl != null) {
                    MemberType member = new MemberType();
                    member.setName(corbaTypeImpl.getQName().getLocalPart());
                    member.setIdltype(corbaTypeImpl.getQName());
                    if (corbaTypeImpl.isSetQualified() && corbaTypeImpl.isQualified()) {
                        member.setQualified(true);
                    }
                    corbaex.getMember().add(member);
                }
            } else {
                corbaex = createCorbaException(name, schemaType);
            }
        }
        if (schemaType == null) {
            String msgStr = "Fault " + fault.getMessage().getQName().getLocalPart()
                 + " INCORRECT_FAULT_MSG.";
            org.apache.cxf.common.i18n.Message msg =
                new org.apache.cxf.common.i18n.Message(msgStr, LOG);
            throw new Exception(msg.toString());
        }

        if (corbaex == null) {
            String msgStr = "Fault " + fault.getMessage().getQName().getLocalPart()
                + " UNSUPPORTED_FAULT.";
            org.apache.cxf.common.i18n.Message msg =
                new org.apache.cxf.common.i18n.Message(msgStr, LOG);
            throw new Exception(msg.toString());
        } else {
            // Set the repository ID for Exception
            // add to CorbaTypeMapping
            String repoId = WSDLToCorbaHelper.REPO_STRING
                + corbaex.getName().replace('.', '/')
                + WSDLToCorbaHelper.IDL_VERSION;
            corbaex.setRepositoryID(repoId);
            CorbaType corbaTypeImpl = corbaex;
            if (!helper.isDuplicate(corbaTypeImpl)) {
                CorbaType dup = helper.isDuplicateException(corbaTypeImpl);
                if (dup != null) {
                    typeMappingType.getStructOrExceptionOrUnion().remove(dup);
                    typeMappingType.getStructOrExceptionOrUnion().add(corbaTypeImpl);
                } else {
                    typeMappingType.getStructOrExceptionOrUnion().add(corbaTypeImpl);
View Full Code Here

    public void cleanUpTypeMap(TypeMappingType typeMap) {
        List<CorbaType> types = typeMap.getStructOrExceptionOrUnion();
        if (types != null) {
            for (int i = 0; i < types.size(); i++) {
                CorbaType type = types.get(i);
                if (type.getQName() != null) {
                    type.setName(type.getQName().getLocalPart());
                    type.setQName(null);
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.binding.corba.wsdl.CorbaType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.