Package org.apache.yoko.wsdl

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


        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

        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

    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

                }
            }
            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

            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

    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

            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

        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

    }         

    private void addCorbaTypes(XmlSchema xmlSchemaTypes) throws Exception {
        XmlSchemaObjectTable objs = xmlSchemaTypes.getSchemaTypes();
        Iterator i = objs.getValues();
        CorbaTypeImpl corbaTypeImpl = null;
        while (i.hasNext()) {               
            XmlSchemaType type = (XmlSchemaType)i.next();
            boolean anonymous = WSDLTypes.isAnonymous(type.getName());
            corbaTypeImpl = helper.convertSchemaToCorbaType(type, type.getQName(), null,
                                                            null, anonymous);
            if (corbaTypeImpl != null) {
                if (corbaTypeImpl.getQName() != null) {
                    corbaTypeImpl.setQName(null);
                }
                if (!helper.isDuplicate(corbaTypeImpl)) {
                    typeMappingType.getStructOrExceptionOrUnion().add(corbaTypeImpl);
                }
            }                  
View Full Code Here

TOP

Related Classes of org.apache.yoko.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.