Package com.ibm.wsdl.extensions.schema

Examples of com.ibm.wsdl.extensions.schema.SchemaImpl


        doc.appendChild(nd);
       
        for (SchemaInfo schemaInfo : schemas) {
           
            if (!useSchemaImports) {
                SchemaImpl schemaImpl = new SchemaImpl();
                schemaImpl.setRequired(true);
                schemaImpl.setElementType(WSDLConstants.QNAME_SCHEMA);
                schemaImpl.setElement(schemaInfo.getElement());
                for (int x = 0; x < schemaInfo.getSchema().getIncludes().getCount(); x++) {
                    XmlSchemaExternal ext = (XmlSchemaExternal)schemaInfo.getSchema()
                        .getIncludes().getItem(x);
                    if (ext.getSchema() == null) {
                        continue;
                    }
                    if (ext instanceof XmlSchemaImport) {
                        SchemaImport imp = schemaImpl.createImport();
                        imp.setNamespaceURI(((XmlSchemaImport)ext).getNamespace());
                        imp.setSchemaLocationURI(((XmlSchemaImport)ext).getSchemaLocation());
                       
                        SchemaImpl schemaImpl2 = new SchemaImpl();
                        schemaImpl2.setRequired(true);
                        schemaImpl2.setElementType(WSDLConstants.QNAME_SCHEMA);
                        schemaImpl2.setDocumentBaseURI(ext.getSchema().getSourceURI());
                        try {
                            schemaImpl2.setElement(ext.getSchema().getSchemaDocument().getDocumentElement());
                        } catch (XmlSchemaSerializerException e) {
                            //ignore
                        }
                        imp.setReferencedSchema(schemaImpl2);

                        schemaImpl.addImport(imp);
                    } else if (ext instanceof XmlSchemaInclude) {
                        SchemaReference imp = schemaImpl.createInclude();
                        imp.setSchemaLocationURI(((XmlSchemaInclude)ext).getSchemaLocation());

                        SchemaImpl schemaImpl2 = new SchemaImpl();
                        schemaImpl2.setRequired(true);
                        schemaImpl2.setElementType(WSDLConstants.QNAME_SCHEMA);
                        schemaImpl2.setDocumentBaseURI(ext.getSchema().getSourceURI());
                        try {
                            schemaImpl2.setElement(ext.getSchema().getSchemaDocument().getDocumentElement());
                        } catch (XmlSchemaSerializerException e) {
                            //ignore
                        }
                        imp.setReferencedSchema(schemaImpl2);
                       
                        schemaImpl.addInclude(imp);
                    } else if (ext instanceof XmlSchemaRedefine) {
                        SchemaReference imp = schemaImpl.createRedefine();
                        imp.setSchemaLocationURI(((XmlSchemaRedefine)ext).getSchemaLocation());
                       
                        SchemaImpl schemaImpl2 = new SchemaImpl();
                        schemaImpl2.setRequired(true);
                        schemaImpl2.setElementType(WSDLConstants.QNAME_SCHEMA);
                        schemaImpl2.setDocumentBaseURI(ext.getSchema().getSourceURI());
                        try {
                            schemaImpl2.setElement(ext.getSchema().getSchemaDocument().getDocumentElement());
                        } catch (XmlSchemaSerializerException e) {
                            //ignore
                        }
                        imp.setReferencedSchema(schemaImpl2);
                       
                        schemaImpl.addRedefine(imp);
                    }
                }
                types.addExtensibilityElement(schemaImpl);
            } else {
                //imports
                String name = baseFileName + "_schema" + (++xsdCount) + ".xsd";
                Element imp = XMLUtils.createElementNS(doc,
                                                       new QName(WSDLConstants.NS_SCHEMA_XSD,
                                                                  "import"));
                imp.setAttribute("schemaLocation", name);
                imp.setAttribute("namespace", schemaInfo.getNamespaceURI());
                nd.appendChild(imp);
                              
                imports.put(name, schemaInfo);
            }

        }
        if (useSchemaImports) {
            SchemaImpl schemaImpl = new SchemaImpl();
            schemaImpl.setRequired(true);
            schemaImpl.setElementType(WSDLConstants.QNAME_SCHEMA);
            schemaImpl.setElement(nd);
            types.addExtensibilityElement(schemaImpl);
        }
        def.setTypes(types);
    }
View Full Code Here


        doc.appendChild(nd);
       
        for (SchemaInfo schemaInfo : schemas) {
           
            if (!useSchemaImports) {
                SchemaImpl schemaImpl = new SchemaImpl();
                schemaImpl.setRequired(true);
                schemaImpl.setElementType(WSDLConstants.QNAME_SCHEMA);
                schemaImpl.setElement(schemaInfo.getElement());
                types.addExtensibilityElement(schemaImpl);
            } else {
                //imports
                String name = baseFileName + "_schema" + (++xsdCount) + ".xsd";
                Element imp = XMLUtils.createElementNS(doc,
                                                       new QName(WSDLConstants.NS_SCHEMA_XSD,
                                                                  "import"));
                imp.setAttribute("schemaLocation", name);
                imp.setAttribute("namespace", schemaInfo.getNamespaceURI());
                nd.appendChild(imp);
                              
                imports.put(name, schemaInfo);
            }

        }
        if (useSchemaImports) {
            SchemaImpl schemaImpl = new SchemaImpl();
            schemaImpl.setRequired(true);
            schemaImpl.setElementType(WSDLConstants.QNAME_SCHEMA);
            schemaImpl.setElement(nd);
            types.addExtensibilityElement(schemaImpl);
        }
        def.setTypes(types);
    }
View Full Code Here

       
        // Import schemas in definition
        if (schemas.getSize() > 0) {
           Types types = flat.createTypes();
           for (Iterator it = schemas.getSchemas().iterator(); it.hasNext();) {
              javax.wsdl.extensions.schema.Schema imp = new SchemaImpl();
              imp.setElement(((Schema)it.next()).getRoot());
              imp.setElementType(new QName("http://www.w3.org/2001/XMLSchema", "schema"));
              types.addExtensibilityElement(imp);
           }
           flat.setTypes(types);
        }
       
View Full Code Here

        doc.appendChild(nd);
       
        for (SchemaInfo schemaInfo : schemas) {
           
            if (!useSchemaImports) {
                SchemaImpl schemaImpl = new SchemaImpl();
                schemaImpl.setRequired(true);
                schemaImpl.setElementType(WSDLConstants.QNAME_SCHEMA);
                schemaImpl.setElement(schemaInfo.getElement());
                types.addExtensibilityElement(schemaImpl);
            } else {
                //imports
                String name = baseFileName + "_schema" + (++xsdCount) + ".xsd";
                Element imp = XMLUtils.createElementNS(doc,
                                                       new QName(WSDLConstants.NS_SCHEMA_XSD,
                                                                  "import"));
                imp.setAttribute("schemaLocation", name);
                imp.setAttribute("namespace", schemaInfo.getNamespaceURI());
                nd.appendChild(imp);
                              
                imports.put(name, schemaInfo);
            }
            // add imports for those schemata which are inlined.
            addRequiredSchemaImports(schemaInfo);
        }
        if (useSchemaImports) {
            SchemaImpl schemaImpl = new SchemaImpl();
            schemaImpl.setRequired(true);
            schemaImpl.setElementType(WSDLConstants.QNAME_SCHEMA);
            schemaImpl.setElement(nd);
            types.addExtensibilityElement(schemaImpl);
        }
        def.setTypes(types);
    }
View Full Code Here

      if (def.getNamespace(targetNamespace) == null)
      {
        def.addNamespace("esbns" + nsSuffixCounter, targetNamespace) ;
      }
      final Types types = def.getTypes() ;
      SchemaImpl schemaImpl = new SchemaImpl();
      final Document schemaDoc = YADOMUtil.createDocument() ;
      final Element xsdElement = schemaDoc.createElementNS(SCHEMA_NAMESPACE, SCHEMA_ELEMENT) ;
      xsdElement.setAttribute(SCHEMA_TARGETNAMESPACE_ATTRIBUTE, targetNamespace) ;
      xsdElement.setAttribute(SCHEMA_VERSION_ATTRIBUTE, SCHEMA_VERSION_VALUE) ;
      final Element xsdInclude = schemaDoc.createElementNS(SCHEMA_NAMESPACE, SCHEMA_INCLUDE_ELEMENT) ;
      xsdInclude.setAttribute(IMPORT_SCHEMA_LOCATION_ATTRIBUTE, schemaLocation) ;
      xsdElement.appendChild(xsdInclude) ;
      schemaImpl.setElement(xsdElement) ;
      schemaImpl.setElementType(XSD_QN);
      types.addExtensibilityElement(schemaImpl);
    }
    final NodeList nodes = YADOMUtil.getNodeList(schemaElement, "/schema/element") ;
    final int numNodes = nodes.getLength() ;
    final QName[] result = new QName[numNodes] ;
View Full Code Here

        doc.appendChild(nd);
       
        for (SchemaInfo schemaInfo : schemas) {
           
            if (!useSchemaImports) {
                SchemaImpl schemaImpl = new SchemaImpl();
                schemaImpl.setRequired(true);
                schemaImpl.setElementType(WSDLConstants.QNAME_SCHEMA);
                schemaImpl.setElement(schemaInfo.getElement());
                types.addExtensibilityElement(schemaImpl);
            } else {
                //imports
                String name = baseFileName + "_schema" + (++xsdCount) + ".xsd";
                Element imp = XMLUtils.createElementNS(doc,
                                                       new QName(WSDLConstants.NS_SCHEMA_XSD,
                                                                  "import"));
                imp.setAttribute("schemaLocation", name);
                imp.setAttribute("namespace", schemaInfo.getNamespaceURI());
                nd.appendChild(imp);
                              
                imports.put(name, schemaInfo);
            }

        }
        if (useSchemaImports) {
            SchemaImpl schemaImpl = new SchemaImpl();
            schemaImpl.setRequired(true);
            schemaImpl.setElementType(WSDLConstants.QNAME_SCHEMA);
            schemaImpl.setElement(nd);
            types.addExtensibilityElement(schemaImpl);
        }
        def.setTypes(types);
    }
View Full Code Here

        definition.setTypes(olddefinition.getTypes());
       
       
       
        Binding binding = definition.getBinding(new QName(targetNs,"IXregistrySOAP11Binding"));
        SchemaImpl impl;
        Document doc = null;
       
        Iterator it = definition.getTypes().getExtensibilityElements().iterator();
        if(it.hasNext()){
            impl = (SchemaImpl)it.next();
            types = impl.getElement();
           
            doc = types.getOwnerDocument();
           
           
        }
View Full Code Here

            first.appendChild(sequence);
            globalSchema.appendChild(first);
        }

        // types.setDocumentationElement(schema);
        SchemaImpl schemaImpl = new SchemaImpl();
//        SchemaImportImpl schemaimport = new SchemaImportImpl();
//        schemaimport.setNamespaceURI("http://www.extreme.indiana.edu/lead/xsd");
//        schemaimport.setSchemaLocationURI("http://www.extreme.indiana.edu/gfac/gfac-simple-types.xsd");
//        schemaImpl.addImport(schemaimport);
       
        Element importEle = doc.createElement("import");
        importEle.setAttribute("namespace","http://www.extreme.indiana.edu/lead/xsd");
        importEle.setAttribute("schemaLocation", "http://www.extreme.indiana.edu/gfac/gfac-simple-types.xsd");
        schema.insertBefore(importEle, schema.getFirstChild());
       
        if(knownTypes.containsKey(LEAD_CROSSCUT_PARAMETERS_NAME)){
            importEle = doc.createElement("import");
            importEle.setAttribute("namespace","http://lead.extreme.indiana.edu/namespaces/2006/lead-crosscut-parameters/");
            importEle.setAttribute("schemaLocation", "http://www.extreme.indiana.edu/gfac/schemas/leadcrosscut.xsd");
            schema.insertBefore(importEle, schema.getFirstChild());
        }
       
       
        //schema.appendChild();
       

        schemaImpl.setElement(schema);
        schemaImpl.setElementType(new QName("http://www.w3.org/2001/XMLSchema",
        "schema"));

        SchemaImpl globalSchemaImpl = new SchemaImpl();
        globalSchemaImpl.setElement(globalSchema);
        globalSchemaImpl.setElementType(new QName(
                "http://www.w3.org/2001/XMLSchema", "schema"));
        globalSchemaImpl.getElement().setAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");

        types.addExtensibilityElement(schemaImpl);
        //types.addExtensibilityElement(globalSchemaImpl);

//        for(Element schemaEle:schemaTable){
View Full Code Here

        // Import schemas in definition
        if (namespaces.size() > 0) {
            Types types = flat.createTypes();
            for (Iterator iter = namespaces.iterator(); iter.hasNext();) {
                String ns = (String) iter.next();
                javax.wsdl.extensions.schema.Schema imp = new SchemaImpl();
                imp.setElement(schemas.getSchema(ns).getRoot());
                imp.setElementType(new QName("http://www.w3.org/2001/XMLSchema", "schema"));
                types.addExtensibilityElement(imp);
            }
            flat.setTypes(types);
        }
        flat.addPortType(flatPort);
View Full Code Here

        doc.appendChild(nd);
       
        for (SchemaInfo schemaInfo : schemas) {
           
            if (!useSchemaImports) {
                SchemaImpl schemaImpl = new SchemaImpl();
                schemaImpl.setRequired(true);
                schemaImpl.setElementType(WSDLConstants.QNAME_SCHEMA);
                schemaImpl.setElement(schemaInfo.getElement());
                types.addExtensibilityElement(schemaImpl);
            } else {
                //imports
                String name = baseFileName + "_schema" + (++xsdCount) + ".xsd";
                Element imp = XMLUtils.createElementNS(doc,
                                                       new QName(WSDLConstants.NS_SCHEMA_XSD,
                                                                  "import"));
                imp.setAttribute("schemaLocation", name);
                imp.setAttribute("namespace", schemaInfo.getNamespaceURI());
                nd.appendChild(imp);
                              
                imports.put(name, schemaInfo);
            }

        }
        if (useSchemaImports) {
            SchemaImpl schemaImpl = new SchemaImpl();
            schemaImpl.setRequired(true);
            schemaImpl.setElementType(WSDLConstants.QNAME_SCHEMA);
            schemaImpl.setElement(nd);
            types.addExtensibilityElement(schemaImpl);
        }
        def.setTypes(types);
    }
View Full Code Here

TOP

Related Classes of com.ibm.wsdl.extensions.schema.SchemaImpl

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.