Package org.apache.tuscany.sca.common.xml.stax.StAXHelper

Examples of org.apache.tuscany.sca.common.xml.stax.StAXHelper.Attribute


        tnsList = helper.readAttributes(wsdl, XSD, "targetNamespace");
        Assert.assertEquals(2, tnsList.size());
        Assert.assertEquals("http://www.example.org/test/xsd1", tnsList.get(0));
        Assert.assertEquals("http://www.example.org/test/xsd2", tnsList.get(1));

        Attribute attr1 = new Attribute(WSDL11, "targetNamespace");
        Attribute attr2 = new Attribute(XSD, "targetNamespace");
        Attribute[] attrs = helper.readAttributes(wsdl, attr1, attr2);

        Assert.assertEquals(2, attrs.length);
        Assert.assertEquals("http://www.example.org/test/wsdl", attrs[0].getValues().get(0));
        Assert.assertEquals("http://www.example.org/test/xsd1", attrs[1].getValues().get(0));
View Full Code Here


        tnsList = helper.readAttributes(wsdl, XSD, "targetNamespace");
        Assert.assertEquals(2, tnsList.size());
        Assert.assertEquals("http://www.example.org/test/xsd1", tnsList.get(0));
        Assert.assertEquals("http://www.example.org/test/xsd2", tnsList.get(1));

        Attribute attr1 = new Attribute(WSDL11, "targetNamespace");
        Attribute attr2 = new Attribute(XSD, "targetNamespace");
        Attribute[] attrs = helper.readAttributes(wsdl, attr1, attr2);

        Assert.assertEquals(2, attrs.length);
        Assert.assertEquals("http://www.example.org/test/wsdl", attrs[0].getValues().get(0));
        Assert.assertEquals("http://www.example.org/test/xsd1", attrs[1].getValues().get(0));
View Full Code Here

    protected WSDLDefinition indexRead(URL doc) throws Exception {
        WSDLDefinition wsdlDefinition = factory.createWSDLDefinition();
        wsdlDefinition.setUnresolved(true);
        wsdlDefinition.setLocation(doc.toURI());

        Attribute attr1 = new Attribute(WSDL11, "targetNamespace");
        Attribute attr2 = new Attribute(XSD, "targetNamespace");
        Attribute[] attrs = helper.readAttributes(doc, attr1, attr2);

        wsdlDefinition.setNamespace(attr1.getValues().get(0));
        // The definition is marked as resolved but not loaded
        wsdlDefinition.setUnresolved(false);
        wsdlDefinition.setDefinition(null);

        int index = 0;
        for (String tns : attr2.getValues()) {
            XSDefinition xsd = xsdFactory.createXSDefinition();
            xsd.setUnresolved(true);
            xsd.setNamespace(tns);
            xsd.setLocation(URI.create(doc.toURI() + "#" + index));
            index++;
            // The definition is marked as resolved but not loaded
            xsd.setUnresolved(false);
            xsd.setSchema(null);
            wsdlDefinition.getXmlSchemas().add(xsd);
        }
       
        if (attr2.getValues().size() == 0){
            // if there are no schema defined add in the XSD schema
            // so this at least gets resolved otherwise we'll get
            // errors when trying to resolve part types that
            // use primitive types
            XSDefinition xsd = xsdFactory.createXSDefinition();
View Full Code Here

    protected WSDLDefinition indexRead(URL doc) throws Exception {
        WSDLDefinition wsdlDefinition = factory.createWSDLDefinition();
        wsdlDefinition.setUnresolved(true);
        wsdlDefinition.setLocation(doc.toURI());

        Attribute attr1 = new Attribute(WSDL11, "targetNamespace");
        Attribute attr2 = new Attribute(XSD, "targetNamespace");
        Attribute[] attrs = helper.readAttributes(doc, attr1, attr2);

        wsdlDefinition.setNamespace(attr1.getValues().get(0));
        // The definition is marked as resolved but not loaded
        wsdlDefinition.setUnresolved(false);
        wsdlDefinition.setDefinition(null);

        int index = 0;
        for (String tns : attr2.getValues()) {
            XSDefinition xsd = xsdFactory.createXSDefinition();
            xsd.setUnresolved(true);
            xsd.setNamespace(tns);
            xsd.setLocation(URI.create(doc.toURI() + "#" + index));
            index++;
            // The definition is marked as resolved but not loaded
            xsd.setUnresolved(false);
            xsd.setSchema(null);
            wsdlDefinition.getXmlSchemas().add(xsd);
        }
       
        if (attr2.getValues().size() == 0){
            // if there are no schema defined add in the XSD schema
            // so this at least gets resolved otherwise we'll get
            // errors when trying to resolve part types that
            // use primitive types
            XSDefinition xsd = xsdFactory.createXSDefinition();
View Full Code Here

        tnsList = helper.readAttributes(wsdl, XSD, "targetNamespace");
        Assert.assertEquals(2, tnsList.size());
        Assert.assertEquals("http://www.example.org/test/xsd1", tnsList.get(0));
        Assert.assertEquals("http://www.example.org/test/xsd2", tnsList.get(1));

        Attribute attr1 = new Attribute(WSDL11, "targetNamespace");
        Attribute attr2 = new Attribute(XSD, "targetNamespace");
        Attribute[] attrs = helper.readAttributes(wsdl, attr1, attr2);

        Assert.assertEquals(2, attrs.length);
        Assert.assertEquals("http://www.example.org/test/wsdl", attrs[0].getValues().get(0));
        Assert.assertEquals("http://www.example.org/test/xsd1", attrs[1].getValues().get(0));
View Full Code Here

    protected WSDLDefinition indexRead(URL doc) throws Exception {
        WSDLDefinition wsdlDefinition = factory.createWSDLDefinition();
        wsdlDefinition.setUnresolved(true);
        wsdlDefinition.setLocation(doc.toURI());

        Attribute attr1 = new Attribute(WSDL11, "targetNamespace");
        Attribute attr2 = new Attribute(XSD, "targetNamespace");
        Attribute[] attrs = helper.readAttributes(doc, attr1, attr2);

        wsdlDefinition.setNamespace(attr1.getValues().get(0));
        // The definition is marked as resolved but not loaded
        wsdlDefinition.setUnresolved(false);
        wsdlDefinition.setDefinition(null);

        int index = 0;
        for (String tns : attr2.getValues()) {
            XSDefinition xsd = xsdFactory.createXSDefinition();
            xsd.setUnresolved(true);
            xsd.setNamespace(tns);
            xsd.setLocation(URI.create(doc.toURI() + "#" + index));
            index++;
View Full Code Here

    protected WSDLDefinition indexRead(URL doc) throws Exception {
        WSDLDefinition wsdlDefinition = factory.createWSDLDefinition();
        wsdlDefinition.setUnresolved(true);
        wsdlDefinition.setLocation(doc.toURI());

        Attribute attr1 = new Attribute(WSDL11, "targetNamespace");
        Attribute attr2 = new Attribute(XSD, "targetNamespace");
        Attribute[] attrs = helper.readAttributes(doc, attr1, attr2);

        wsdlDefinition.setNamespace(attr1.getValues().get(0));
        // The definition is marked as resolved but not loaded
        wsdlDefinition.setUnresolved(false);
        wsdlDefinition.setDefinition(null);

        int index = 0;
        for (String tns : attr2.getValues()) {
            XSDefinition xsd = xsdFactory.createXSDefinition();
            xsd.setUnresolved(true);
            xsd.setNamespace(tns);
            xsd.setLocation(URI.create(doc.toURI() + "#" + index));
            index++;
            // The definition is marked as resolved but not loaded
            xsd.setUnresolved(false);
            xsd.setSchema(null);
            wsdlDefinition.getXmlSchemas().add(xsd);
        }
       
        if (attr2.getValues().size() == 0){
            // if there are no schema defined add in the XSD schema
            // so this at least gets resolved otherwise we'll get
            // errors when trying to resolve part types that
            // use primitive types
            XSDefinition xsd = xsdFactory.createXSDefinition();
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.common.xml.stax.StAXHelper.Attribute

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.