Package org.apache.wsdl.extensions

Examples of org.apache.wsdl.extensions.Schema


            element = (WSDLExtensibilityElement) iterator.next();
            if (ExtensionConstants.SCHEMA.equals(element.getType()))
                break;
        }
        assertNotNull(element);
        Schema schema = (Schema) element;
        NodeList childNodes = schema.getElement().getChildNodes();
        Element insertedElementForMessageReference = null;
        for (int i = 0; i < childNodes.getLength(); i++) {
            Node item = childNodes.item(i);

            if (item instanceof Element
View Full Code Here


    private WSDLInterface generatePortType(WSDLDescription womDescription,
                                           WSDLComponentFactory wsdlComponentFactory, Element documentElement) {
        WSDLTypes wsdlTypes = wsdlComponentFactory.createTypes();
        ExtensionFactory extensionFactory = wsdlComponentFactory
                .createExtensionFactory();
        Schema schemaExtensibilityElement = (Schema) extensionFactory
                .getExtensionElement(ExtensionConstants.SCHEMA);
        wsdlTypes.addExtensibilityElement(schemaExtensibilityElement);
        schemaExtensibilityElement.setElement(documentElement);
        womDescription.setTypes(wsdlTypes);

        WSDLInterface portType = womDescription.createInterface();
        portType.setName(new QName(axisService.getName() + "Port"));
View Full Code Here

    private WSDLInterface generatePortType(WSDLDescription womDescription,
                                           WSDLComponentFactory wsdlComponentFactory,
                                           Element documentElement) {
        WSDLTypes wsdlTypes = wsdlComponentFactory.createTypes();
        ExtensionFactory extensionFactory = wsdlComponentFactory.createExtensionFactory();
        Schema schemaExtensibilityElement =
                (Schema) extensionFactory.getExtensionElement(
                        ExtensionConstants.SCHEMA);
        wsdlTypes.addExtensibilityElement(schemaExtensibilityElement);
        schemaExtensibilityElement.setElement(documentElement);
        womDescription.setTypes(wsdlTypes);

        WSDLInterface portType = womDescription.createInterface();
        portType.setName(new QName(axisService.getName() + "Port"));
View Full Code Here

        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.getElement().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

            element = (WSDLExtensibilityElement) iterator.next();
            if (ExtensionConstants.SCHEMA.equals(element.getType()))
                break;
        }
        assertNotNull(element);
        Schema schema = (Schema) element;
        NodeList childNodes = schema.getElement().getChildNodes();
        Element insertedElementForMessageReference = null;
        for (int i = 0; i < childNodes.getLength(); i++) {
            Node item = childNodes.item(i);
            if (item instanceof Element
                    && "complexType".equals(((Element) item).getTagName())
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).getLocalName())){
                        targetnamespaceFound = true;
                        break;
                    }
                }
                if (!targetnamespaceFound)
                    throw new CodeGenerationException(
                            "Invalid WSDL: The WSDL Types Schema does not define a targetNamespace in "+schema.getName() );
            }

        }
    }
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();
                    //compile these schemas
                    while (!importedSchemaStack.isEmpty()){
                        javax.wsdl.extensions.schema.Schema tempSchema = (javax.wsdl.extensions.schema.Schema) importedSchemaStack.pop();
                        Element element = tempSchema.getElement();
                        xmlObjectsVector.add(
View Full Code Here

            for (int i = 0; i < typesArray.size(); i++) {
                extensiblityElt = (WSDLExtensibilityElement) typesArray.get(i);
                Vector xmlObjectsVector = new Vector();
                XmlSchemaCollection schemaColl = new XmlSchemaCollection();
                Schema schema = null;

                if (ExtensionConstants.SCHEMA.equals(extensiblityElt.getType())) {
                    schema = (Schema) extensiblityElt;
                    Map inScopeNS = configuration.getWom().getNamespaces();
                    for (Iterator it = inScopeNS.keySet().iterator(); it.hasNext();) {
                        String prefix = (String) it.next();
                        schemaColl.mapNamespace(prefix,
                                                (String)inScopeNS.get(prefix));
                    }

                    Stack importedSchemaStack = schema.getImportedSchemaStack();
                    //compile these schemas
                    while (!importedSchemaStack.isEmpty()) {
                        Element el = ((javax.wsdl.extensions.schema.Schema)importedSchemaStack.pop()).getElement();
                        XmlSchema thisSchema = schemaColl.read(el);
                        xmlObjectsVector.add(thisSchema);
View Full Code Here

            element = (WSDLExtensibilityElement) iterator.next();
            if (ExtensionConstants.SCHEMA.equals(element.getType()))
                break;
        }
        assertNotNull(element);
        Schema schema = (Schema) element;
        NodeList childNodes = schema.getElement().getChildNodes();
        Element insertedElementForMessageReference = null;
        for (int i = 0; i < childNodes.getLength(); i++) {
            Node item = childNodes.item(i);

            if (item instanceof Element
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(
                            "Invalid WSDL: The WSDL Types Schema does not define a targetNamespace in "+schema.getName() );
            }

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