Examples of TypeMappingType


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

    public static CorbaTypeMap createCorbaTypeMap(List<TypeMappingType> tmTypes) {
        CorbaTypeMap map = null;
        if (tmTypes != null) {
            //Currently, only one type map
            TypeMappingType tmType = tmTypes.get(0);
            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
View Full Code Here

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

        types.addExtensibilityElement(wsdlSchema);
    }

    public TypeMappingType createCorbaTypeMap(Definition definition, String corbatypemaptns)
        throws WSDLException {
        TypeMappingType typeMap = (TypeMappingType)
            definition.getExtensionRegistry().createExtension(Definition.class,
                                                              CorbaConstants.NE_CORBA_TYPEMAPPING);
        if (corbatypemaptns == null) {
            typeMap.setTargetNamespace(definition.getTargetNamespace()
                + "/"
                + CorbaConstants.NS_CORBA_TYPEMAP);
        } else {
            typeMap.setTargetNamespace(corbatypemaptns);
        }
        definition.addExtensibilityElement(typeMap);
        return typeMap;
    }
View Full Code Here

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

            Element typemap = getElementNode(document, "corba:typeMapping");           
            assertNotNull(typemap);
            assertEquals(2, typemap.getElementsByTagName("corba:union").getLength());
            assertEquals(1, typemap.getElementsByTagName("corba:struct").getLength());           
           
            TypeMappingType mapType = (TypeMappingType)model.getExtensibilityElements().get(0);           

            WSDLToIDLAction idlgen = new WSDLToIDLAction();
            idlgen.setBindingName("NillableCORBABinding");
            idlgen.setOutputFile("nillable.idl");
            idlgen.generateIDL(model);
           
            Union un = (Union)mapType.getStructOrExceptionOrUnion().get(2);
            assertEquals("Name is incorrect for Union Type", "long_nil",
                         un.getName());
            assertEquals("Type is incorrect for Union Type", "PEl",
                         un.getType().getLocalPart());
            Unionbranch unbranch = un.getUnionbranch().get(0);
View Full Code Here

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

            assertNotNull(typemap);
            assertEquals(3, typemap.getElementsByTagName("corba:union").getLength());           
            assertEquals(1, typemap.getElementsByTagName("corba:anonstring").getLength());           
            assertEquals(17, typemap.getElementsByTagName("corba:struct").getLength());           
           
            TypeMappingType mapType = (TypeMappingType)model.getExtensibilityElements().get(0);           

            WSDLToIDLAction idlgen = new WSDLToIDLAction();
            idlgen.setBindingName("TypeInheritanceCORBABinding");
            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",
View Full Code Here

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

            assertNotNull(typemap);
            assertEquals(1, typemap.getElementsByTagName("corba:anonfixed").getLength());           
            assertEquals(1, typemap.getElementsByTagName("corba:anonstring").getLength());           
            assertEquals(3, typemap.getElementsByTagName("corba:struct").getLength());           
           
            TypeMappingType mapType = (TypeMappingType)model.getExtensibilityElements().get(0);           

            WSDLToIDLAction idlgen = new WSDLToIDLAction();
            idlgen.setBindingName("XCORBABinding");
            idlgen.setOutputFile("atype.idl");
            idlgen.generateIDL(model);

            Anonstring str = (Anonstring)mapType.getStructOrExceptionOrUnion().get(2);
            assertEquals("Name is incorrect for Array Type", "X._1_S",
                         str.getName());
            assertEquals("Type is incorrect for AnonString Type", "string",
                         str.getType().getLocalPart());
           
            Anonfixed fx = (Anonfixed)mapType.getStructOrExceptionOrUnion().get(3);
            assertEquals("Name is incorrect for Anon Array Type", "X._2_S",
                         fx.getName());
            assertEquals("Type is incorrect for AnonFixed Type", "decimal",
                         fx.getType().getLocalPart());
           
            Struct struct = (Struct)mapType.getStructOrExceptionOrUnion().get(1);
            assertEquals("Name is incorrect for Anon Array Type", "X.S",
                         struct.getName());           
            assertEquals("Type is incorrect for Struct Type", "X.S",
                         struct.getType().getLocalPart());
            assertEquals("Name for first Struct Member Type is incorrect", "str",
View Full Code Here

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

            assertEquals(3, typemap.getElementsByTagName("corba:anonsequence").getLength());        
            assertEquals(2, typemap.getElementsByTagName("corba:anonarray").getLength());
            assertEquals(1, typemap.getElementsByTagName("corba:array").getLength());
            assertEquals(2, typemap.getElementsByTagName("corba:struct").getLength());           

            TypeMappingType mapType = (TypeMappingType)model.getExtensibilityElements().get(0);
            Map<String, CorbaTypeImpl> tmap = new HashMap<String, CorbaTypeImpl>();
            for (CorbaTypeImpl type : mapType.getStructOrExceptionOrUnion()) {
                tmap.put(type.getName(), type);
            }


            WSDLToIDLAction idlgen = new WSDLToIDLAction();
View Full Code Here

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

            String fileName = getClass().getResource("/wsdl/any.wsdl").toString();
            generator.setWsdlFile(fileName);
            generator.addInterfaceName("anyInterface");           
            Definition model = generator.generateCORBABinding();

            TypeMappingType mapType = (TypeMappingType)model.getExtensibilityElements().get(0);
            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) {
View Full Code Here

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

        Element bindingElement = getElementNode(document, "binding");       
        assertEquals(5, bindingElement.getElementsByTagName("corba:operation").getLength());
        QName bName = new QName("http://schemas.apache.org/idl/fixed.idl",
                                "YCORBABinding", "tns");
        Binding binding = model.getBinding(bName);
        TypeMappingType mapType = (TypeMappingType)model.getExtensibilityElements().get(0);
        Map<String, CorbaTypeImpl> tmap = new HashMap<String, CorbaTypeImpl>();
        for (CorbaTypeImpl type : mapType.getStructOrExceptionOrUnion()) {
            tmap.put(type.getName(), type);
        }
       
        Iterator j = binding.getBindingOperations().iterator();
        while (j.hasNext()) {           
View Full Code Here

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

                                                       XmlSchema currentSchema,
                                                       AST node,
                                                       WSDLASTVisitor wsdlVisitor,
                                                       VisitorTypeHolder holder) {
        XmlSchemaCollection schemas = wsdlVisitor.getSchemas();
        TypeMappingType typeMap = wsdlVisitor.getTypeMap();
        ModuleToNSMapper mapper = wsdlVisitor.getModuleToNSMapper();
        WSDLSchemaManager manager = wsdlVisitor.getManager();
       
        Scope scopedName = new Scope(scope, node);
        String name = node.toString();
View Full Code Here

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

    private static boolean findScopeSchemaType(Scope scopedName, XmlSchema schemaRef,
                                           WSDLASTVisitor wsdlVisitor,
                                           VisitorTypeHolder holder) {
       
        XmlSchemaCollection schemas = wsdlVisitor.getSchemas();
        TypeMappingType typeMap = wsdlVisitor.getTypeMap();
        ModuleToNSMapper mapper = wsdlVisitor.getModuleToNSMapper();
        WSDLSchemaManager manager = wsdlVisitor.getManager();

        boolean result = findNonSchemaType(scopedName.toString(), wsdlVisitor, holder);
        if (!result) {
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.