Examples of CorbaTypeImpl


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

            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

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

    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

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

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

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

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

        return corbatype;
    }

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

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

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

    private static ParamType createParam(WSDLToCorbaBinding wsdlToCorbaBinding,
            String mode, XmlSchemaType schemaType, String name, QName typeName,
            boolean nill) throws Exception {

        CorbaTypeImpl corbaTypeImpl = null;
        ParamType paramtype = new ParamType();

        ModeType modeType = ModeType.fromValue(mode);
        paramtype.setName(name);
        paramtype.setMode(modeType);

        if (schemaType == null) {
            corbaTypeImpl = (CorbaTypeImpl) WSDLToCorbaHelper.CORBAPRIMITIVEMAP
                    .get(typeName);
            if (nill) {
                QName qname = corbaTypeImpl.getQName();
                qname = wsdlToCorbaBinding.getHelper()
                        .createQNameCorbaNamespace(
                                qname.getLocalPart() + "_nil");
                paramtype.setIdltype(qname);
            } else {
                paramtype.setIdltype(corbaTypeImpl.getQName());
            }
        } else {
            // We need to get annotation information for the schema type we are about to pass in.
            // This is used to produce the correct object reference type.
            List<XmlSchema> schemaList = wsdlToCorbaBinding.getHelper().getXMLSchemaList();
            Iterator<XmlSchema> schemaIterator = schemaList.iterator();
            XmlSchemaObject schemaObj = null;
            while (schemaIterator.hasNext()) {
                XmlSchema s = schemaIterator.next();
                XmlSchemaObjectTable schemaTable = s.getElements();
                schemaObj = schemaTable.getItem(typeName);
                if (schemaObj != null) {
                    break;
                }
            }
           
            XmlSchemaAnnotation annotation = null;
            if (schemaObj != null && schemaObj instanceof XmlSchemaElement) {
                annotation = ((XmlSchemaElement)schemaObj).getAnnotation();
            }
           
            corbaTypeImpl = wsdlToCorbaBinding.getHelper()
                    .convertSchemaToCorbaType(schemaType, typeName, null, annotation, false);
            if (corbaTypeImpl == null) {
                return null;
            } else {
                if (nill) {
                    QName qname = corbaTypeImpl.getQName();
                    qname = wsdlToCorbaBinding.getHelper()
                            .createQNameCorbaNamespace(
                                    qname.getLocalPart() + "_nil");
                    paramtype.setIdltype(qname);
                } else {
                    paramtype.setIdltype(corbaTypeImpl.getQName());
                }
            }
            return paramtype;
        }
        return paramtype;
View Full Code Here

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

                }
            }
            if (typeMappingType != null) {
                Iterator i = typeMappingType.getStructOrExceptionOrUnion().iterator();
                while (i.hasNext()) {
                    CorbaTypeImpl corbaTypeImpl = (CorbaTypeImpl)i.next();                               
                    findCorbaIdlType(corbaTypeImpl);
                }
            }
        } catch (Exception ex) {
            ex.printStackTrace();
View Full Code Here

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

            ex.printStackTrace();
        }
    }

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

        try {

            Iterator types = def.getExtensibilityElements().iterator();
            TypeMappingType typeMappingType = null;
            if (types != null) {
                while (types.hasNext()) {
                    typeMappingType = (TypeMappingType)types.next();
                }
            }
            Iterator i = typeMappingType.getStructOrExceptionOrUnion().iterator();
            while (i.hasNext()) {
                CorbaTypeImpl corbaType = (CorbaTypeImpl)i.next();                              
                if (corbaType.getName().equals(qname.getLocalPart())) {                   
                    return corbaType;
                }
            }
        } catch (Exception ex) {
            ex.printStackTrace();
View Full Code Here

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

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

        CorbaTypeImpl  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;
        String dotScopedName = "";

        for (int i = 0; i < name.length - 1; ++i) {
            dotScopedName += 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 (dotScopedName.equals("CORBA") && name.length == 2 && i == 0) {
                if (name[i + 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);

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

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

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

            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

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

        Map faults = op.getFaults();
        Iterator i = faults.values().iterator();              
        while (i.hasNext()) {
            Fault fault = (Fault)i.next();
            RaisesType raisestype = new RaisesType();           
            CorbaTypeImpl extype = convertFaultToCorbaType(xmlSchemaType, fault);

            if (extype != null) {
                raisestype.setException(helper.createQNameCorbaNamespace(extype.getName()));               
                operationType.getRaises().add(raisestype);
            }
        }
              
        bo.addExtensibilityElement(operationType);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.