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

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


                    faultName = faultName + "Exception";
                }
                QName faultMsgName = helper.createQNameCorbaNamespace(faultName);
                corbaex.setName(faultName);
                corbaex.setQName(faultMsgName);
                CorbaTypeImpl 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);
            CorbaTypeImpl corbaTypeImpl = (CorbaTypeImpl)corbaex;
            if (!helper.isDuplicate(corbaTypeImpl)) {
                CorbaTypeImpl 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<CorbaTypeImpl> types = typeMap.getStructOrExceptionOrUnion();
        if (types != null) {
            for (int i = 0; i < types.size(); i++) {
                CorbaTypeImpl type = types.get(i);
                if (type.getQName() != null) {
                    type.setName(type.getQName().getLocalPart());
                    type.setQName(null);
                }
            }
        }
    }
View Full Code Here

            idlgen.setOutputFile("typeInherit.idl");
            idlgen.generateIDL(model);

            List<CorbaTypeImpl> types = mapType.getStructOrExceptionOrUnion();
            for (int i = 0; i < types.size(); i++) {
                CorbaTypeImpl type = types.get(i);
                if ("Type5SequenceStruct".equals(type.getName())) {
                    assertTrue("Name is incorrect for Type5SequenceStruct Type", type instanceof Struct);
                    assertEquals("Type is incorrect for AnonSequence Type", "Type5",
                                 type.getType().getLocalPart());
                } else if ("attrib2Type".equals(type.getName())) {
                    assertTrue("Name is incorrect for attrib2Type Type", type instanceof Anonstring);
                    assertEquals("Type is incorrect for AnonString Type", "string",
                                 type.getType().getLocalPart());
                else if ("attrib2Type_nil".equals(type.getName())) {
                    assertTrue("Name is incorrect for Struct Type", type instanceof Union);
                    assertEquals("Type is incorrect for AnonSequence Type", "attrib2",
                                 type.getType().getLocalPart());
                }
            }
            File f = new File("typeInherit.idl");
            assertTrue("typeInherit.idl should be generated", f.exists());
        } finally {
View Full Code Here

            idlgen.setOutputFile("atype.idl");
            idlgen.generateIDL(model);

            List<CorbaTypeImpl> types = mapType.getStructOrExceptionOrUnion();
            for (int i = 0; i < types.size(); i++) {
                CorbaTypeImpl type = types.get(i);
                if (type instanceof Anonstring) {
                    Anonstring str = (Anonstring)type;
                    assertEquals("Name is incorrect for Array Type", "X._1_S",
                         str.getName());
                    assertEquals("Type is incorrect for AnonString Type", "string",
View Full Code Here

            assertEquals(5, mapType.getStructOrExceptionOrUnion().size());
            Iterator i = mapType.getStructOrExceptionOrUnion().iterator();
            int strcnt = 0;
            int unioncnt = 0;
            while (i.hasNext()) {
                CorbaTypeImpl corbaType = (CorbaTypeImpl)i.next();
                if (corbaType instanceof Struct) {
                    strcnt++;
                }
                if (corbaType instanceof Union) {
                    unioncnt++;
View Full Code Here

    }
   
    public static String getConstValueByName(AST node, TypeMappingType typeMap) {
        List<CorbaTypeImpl> types = typeMap.getStructOrExceptionOrUnion();
        for (Iterator<CorbaTypeImpl> it = types.iterator(); it.hasNext();) {
            CorbaTypeImpl corbaType = it.next();
            if (corbaType instanceof Const) {
                Const corbaConst = (Const) corbaType;
                String name = corbaConst.getQName().getLocalPart();
                if (name.equals(node.getText())) {
                    return corbaConst.getValue();
View Full Code Here

            map = new CorbaTypeMap(tmType.getTargetNamespace());

            List<CorbaTypeImpl> types = tmType.getStructOrExceptionOrUnion();
            LOG.fine("Found " + types.size() + " types defined in the typemap");
            for (Iterator<CorbaTypeImpl> it = types.iterator(); it.hasNext();) {
                CorbaTypeImpl corbaType = it.next();
                String name = corbaType.getName();
                // There can be some instances where a prefix is added to the name by the tool
                // (e.g. Object Reference Names).  Since the name is read as a string, this
                // prefix is added to the types name.  Remove this as it is not needed.
                int pos = name.lastIndexOf(":");
                if (pos != -1) {
                    name = name.substring(pos + 1);
                    corbaType.setName(name);
                }

                map.addType(name, corbaType);
                LOG.fine("Adding type " + name);
            }
View Full Code Here

    public static CorbaTypeImpl processObject(Definition definition, XmlSchemaComplexType complex, 
                                              XmlSchemaAnnotation annotation, QName typeName,
                                              QName defaultName, String idlNamespace)
        throws Exception {
        CorbaTypeImpl corbaTypeImpl = null;
               
        if (annotation != null) {
            Iterator i = annotation.getItems().getIterator();
            while (i.hasNext()) {
                XmlSchemaAppInfo appInfo = (XmlSchemaAppInfo)i.next();
View Full Code Here

        return corbaTypeImpl;
    }
   
    public static CorbaTypeImpl mapToArray(QName name, QName schematypeName, QName arrayType,
                                           QName elName, int bound, boolean anonymous) {
        CorbaTypeImpl corbatype = null;
           
        //schematypeName = checkPrefix(schematypeName);

        if (!anonymous) {
            //Create an Array
View Full Code Here

        return corbatype;
    }

    public static CorbaTypeImpl mapToSequence(QName name, QName schematypeName, QName arrayType,
                                              QName elName, int bound, boolean anonymous) {
        CorbaTypeImpl corbaTypeImpl = null;

        //schematypeName = checkPrefix(schematypeName);
        if (!anonymous) {
            // Create a Sequence
            Sequence corbaSeq = new Sequence();
View Full Code Here

TOP

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

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.