Package org.apache.wsdl.extensions

Examples of org.apache.wsdl.extensions.Schema


            //create the type mapper
            JavaTypeMapper mapper = new JavaTypeMapper();

            for (int i = 0; i < typesArray.size(); i++) {
                extensiblityElt = (WSDLExtensibilityElement) typesArray.get(i);
                Schema schema;

                if (ExtensionConstants.SCHEMA.equals(extensiblityElt.getType())) {
                    schema = (Schema) extensiblityElt;
                    XmlOptions options = new XmlOptions();

                    options.setLoadAdditionalNamespaces(
                            configuration.getWom().getNamespaces()); //add the namespaces


                    Stack importedSchemaStack = schema.getImportedSchemaStack();
                    File schemaFolder = new File(configuration.getOutputLocation(), SCHEMA_FOLDER);
                    schemaFolder.mkdir();
                    //compile these schemas
                    while (!importedSchemaStack.isEmpty()) {
                        Element element = (Element)importedSchemaStack.pop();
View Full Code Here


                String key;
                while (keys.hasNext()) {
                    key = (String) keys.next();
                    schemaColl.mapNamespace(key,(String)nsMap.get(key));
                }
                Schema schema;

                if (ExtensionConstants.SCHEMA.equals(extensiblityElt.getType())) {
                    schema = (Schema) extensiblityElt;
                    Stack importedSchemaStack = schema.getImportedSchemaStack();
                    //compile these schemas
                    while (!importedSchemaStack.isEmpty()) {
                        Element el = (Element)importedSchemaStack.pop();
                        if (el!=null){
                            XmlSchema thisSchema = schemaColl.read(el);
View Full Code Here

                String key;
                while (keys.hasNext()) {
                    key = (String) keys.next();
                    schemaColl.mapNamespace(key, (String) nsMap.get(key));
                }
                Schema schema;

                if (ExtensionConstants.SCHEMA.equals(extensiblityElt.getType())) {
                    schema = (Schema) extensiblityElt;
                    Stack importedSchemaStack = schema.getImportedSchemaStack();
                    //compile these schemas
                    while (!importedSchemaStack.isEmpty()) {
                        Element el = (Element) importedSchemaStack.pop();
                        if (el != null) {
                            XmlSchema thisSchema = schemaColl.read(el);
View Full Code Here

        Iterator iterator = typesList.getExtensibilityElements().iterator();
        while (iterator.hasNext()) {
            WSDLExtensibilityElement element = (WSDLExtensibilityElement) iterator.next();
            boolean targetnamespaceFound = false;
            if (ExtensionConstants.SCHEMA.equals(element.getType())) {
                Schema schema = (Schema) element;
                Element schemaElement = schema.getElement();
                //first check whether the schema include import statements.
                //As per the nature of WSDL if the schema has imports ONLY, then the
                //schema element need not contain a target namespace.
                NodeList importNodeList = schemaElement.getElementsByTagNameNS(schemaElement.getNamespaceURI(), "import");
                NodeList allNodes = schemaElement.getElementsByTagName("*");

                //checking the number of child elements and the number of import elements should get us what we need
                //if these match, that means we have only import statements

                if (importNodeList.getLength()== allNodes.getLength()) {
                    return;
                }


                NamedNodeMap attributes = schemaElement.getAttributes();
                for (int i = 0; i < attributes.getLength(); i++) {

                    if (TARGETNAMESPACE_STRING.equalsIgnoreCase(
                            attributes.item(i).getNodeName())) {
                        targetnamespaceFound = true;
                        break;
                    }
                }
                if (!targetnamespaceFound)
                    throw new CodeGenerationException(
                            CodegenMessages.getMessage("extension.invalidWSDL",schema.getName().toString()));

            }

        }
    }
View Full Code Here

            //create the type mapper
            JavaTypeMapper mapper = new JavaTypeMapper();

            for (int i = 0; i < typesArray.size(); i++) {
                extensiblityElt = (WSDLExtensibilityElement) typesArray.get(i);
                Schema schema;

                if (ExtensionConstants.SCHEMA.equals(extensiblityElt.getType())) {
                    schema = (Schema) extensiblityElt;
                    XmlOptions options = new XmlOptions();

                    options.setLoadAdditionalNamespaces(
                            configuration.getWom().getNamespaces()); //add the namespaces


                    Stack importedSchemaStack = schema.getImportedSchemaStack();
                    File schemaFolder = null;
                    if(debug) {
                        schemaFolder = new File(configuration.getOutputLocation(), SCHEMA_FOLDER);
                        schemaFolder.mkdir();
                    }
View Full Code Here

            //create the type mapper
            JavaTypeMapper mapper = new JavaTypeMapper();

            for (int i = 0; i < typesArray.size(); i++) {
                extensiblityElt = (WSDLExtensibilityElement) typesArray.get(i);
                Schema schema;

                if (ExtensionConstants.SCHEMA.equals(extensiblityElt.getType())) {
                    schema = (Schema) extensiblityElt;

//                    TODO: FIXME                   
//                    Map namespaceMap = configuration.getWom().getNamespaces();
//                    if (namespaceMap != null && !namespaceMap.isEmpty()) {
//                        Iterator nameSpaces = namespaceMap.keySet().iterator();
//                        String nsPrefix;
//                        String nsURI;
//                        while (nameSpaces.hasNext()) {
//                            nsPrefix = (String) nameSpaces.next();
//                            nsURI = namespaceMap.get(nsPrefix).toString();
//                            parser.addImport(nsURI, null);
//                        }
//                    }

                    Stack importedSchemaStack = schema.getImportedSchemaStack();
                    File schemaFolder = null;
                    if(debug) {
                        schemaFolder = new File(configuration.getOutputLocation(), SCHEMA_FOLDER);
                        schemaFolder.mkdir();
                    }
View Full Code Here

        Iterator iterator = typesList.getExtensibilityElements().iterator();
        while (iterator.hasNext()) {
            WSDLExtensibilityElement element = (WSDLExtensibilityElement) iterator.next();
            boolean targetnamespaceFound = false;
            if (ExtensionConstants.SCHEMA.equals(element.getType())) {
                Schema schema = (Schema) element;
                Element schemaElement = schema.getElement();
                //first check whether the schema include only a single import statement.
                //As per the nature of WSDL if the schema has a single import ONLY, then the
                //schema element need not contain a target namespace.
                NodeList importNodeList = schemaElement.getElementsByTagNameNS(schemaElement.getNamespaceURI(), "import");
                NodeList allNodes = schemaElement.getElementsByTagName("*");
                //checking the number of child elements and the number of import elements should get us what we need
                if (importNodeList.getLength() == 1 && allNodes.getLength() == 1) {
                    return;
                }


                NamedNodeMap attributes = schemaElement.getAttributes();
                for (int i = 0; i < attributes.getLength(); i++) {

                    if (TARGETNAMESPACE_STRING.equalsIgnoreCase(
                            attributes.item(i).getNodeName())) {
                        targetnamespaceFound = true;
                        break;
                    }
                }
                if (!targetnamespaceFound)
                    throw new CodeGenerationException(
                            CodegenMessages.getMessage("extension.invalidWSDL",schema.getName().toString()));

            }

        }
    }
View Full Code Here

            //create the type mapper
            JavaTypeMapper mapper = new JavaTypeMapper();

            for (int i = 0; i < typesArray.size(); i++) {
                extensiblityElt = (WSDLExtensibilityElement) typesArray.get(i);
                Schema schema;

                if (ExtensionConstants.SCHEMA.equals(extensiblityElt.getType())) {
                    schema = (Schema) extensiblityElt;
                    XmlOptions options = new XmlOptions();

                    options.setLoadAdditionalNamespaces(
                            configuration.getWom().getNamespaces()); //add the namespaces


                    Stack importedSchemaStack = schema.getImportedSchemaStack();
                    File schemaFolder = null;
                    if(debug) {
                        schemaFolder = new File(configuration.getOutputLocation(), SCHEMA_FOLDER);
                        schemaFolder.mkdir();
                    }
View Full Code Here

                String key;
                while (keys.hasNext()) {
                    key = (String) keys.next();
                    schemaColl.mapNamespace(key, (String) nsMap.get(key));
                }
                Schema schema;

                if (ExtensionConstants.SCHEMA.equals(extensiblityElt.getType())) {
                    schema = (Schema) extensiblityElt;
                    Stack importedSchemaStack = schema.getImportedSchemaStack();
                    //compile these schemas
                    while (!importedSchemaStack.isEmpty()) {
                        Element el = (Element) importedSchemaStack.pop();
                        if (el != null) {
                            XmlSchema thisSchema = schemaColl.read(el);
View Full Code Here

    WSDLOperation operation2 = (WSDLOperation)interface1.getAllOperations().get("getBookPriceNonRobust");
    QName element2 = operation2.getInputMessage().getElement();
    assertEquals(element1, element2);
   
    Iterator iterator = womDescription.getTypes().getExtensibilityElements().iterator();
    Schema types= null;
    while(iterator.hasNext()){
      WSDLExtensibilityElement temp = (WSDLExtensibilityElement)iterator.next();
      if(ExtensionConstants.SCHEMA.equals(temp.getType())){
        types = (Schema)temp;
      }
    }
    int numberOfBookQuote_getBookPrice = 0;
    NodeList childNodes = types.getElelment().getChildNodes();
    for(int i=0; i< childNodes.getLength(); i++){
      Node item = childNodes.item(i);
      if(item instanceof Element){
        Element temp = (Element)item;
        if("complexType".equals(temp.getNodeName()) &&
View Full Code Here

TOP

Related Classes of org.apache.wsdl.extensions.Schema

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.