Package org.apache.ws.commons.schema

Examples of org.apache.ws.commons.schema.XmlSchemaCollection


         * </element> </sequence> </complexType> </schema>
         */

        QName elementQName = new QName("http://soapinterop.org/types", "constraintTest");
        InputStream is = new FileInputStream(Resources.asURI("constraints.xsd"));
        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        schemaCol.read(new StreamSource(is));

        XmlSchemaElement elem = schemaCol.getElementByQName(elementQName);
        assertNotNull(elem);
        assertEquals("constraintTest", elem.getName());
        assertEquals(new QName("http://soapinterop.org/types", "constraintTest"), elem.getQName());

        List<XmlSchemaIdentityConstraint> c = elem.getConstraints();
View Full Code Here


        // create a DOM document
        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        documentBuilderFactory.setNamespaceAware(true);
        Document doc = documentBuilderFactory.newDocumentBuilder().parse(Resources.asURI("importBase.xsd"));

        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        schemaCol.setBaseUri(Resources.TEST_RESOURCES);
        XmlSchema schema = schemaCol.read(doc, null);
        assertNotNull(schema);

        // attempt with slash now
        schemaCol = new XmlSchemaCollection();
        schemaCol.setBaseUri(Resources.TEST_RESOURCES + "/");
        schema = schemaCol.read(doc, null);
        assertNotNull(schema);
    }
View Full Code Here

        // create a DOM document
        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        documentBuilderFactory.setNamespaceAware(true);
        Document doc = documentBuilderFactory.newDocumentBuilder().parse(file.toURI().toURL().toString());

        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        XmlSchema schema = schemaCol.read(doc, file.toURI().toURL().toString());
        assertNotNull(schema);

    }
View Full Code Here

        // create a DOM document
        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        documentBuilderFactory.setNamespaceAware(true);
        Document doc = documentBuilderFactory.newDocumentBuilder().parse(file.toURI().toURL().toString());

        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        XmlSchema schema = schemaCol.read(doc, file.toURI().toURL().toString());
        assertNotNull(schema);

        assertNotNull(schema.getTypeByName(new QName("http://soapinterop.org/xsd2", "SOAPStruct")));
        assertNotNull(schema.getElementByName(new QName("http://soapinterop.org/xsd2", "SOAPWrapper")));
    }
View Full Code Here

     * Tests that imports without <tt>schemaLocation</tt> are resolved if the corresponding schemas
     * have been registered using {@link XmlSchemaCollection#getKnownNamespaceMap()}.
     */
    @Test
    public void testImportWithKnownNamespace() {
        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        schemaCol.getKnownNamespaceMap().put("http://www.w3.org/XML/1998/namespace",
                new XmlSchemaCollection().read(new InputSource(Resources.asURI("xml.xsd"))));
        XmlSchema schema = schemaCol.read(new InputSource(Resources.asURI("knownNamespace.xsd")));
        List<XmlSchemaExternal> externals = schema.getExternals();
        assertEquals(1, externals.size());
        XmlSchemaImport schemaImport = (XmlSchemaImport)externals.get(0);
        assertEquals("http://www.w3.org/XML/1998/namespace", schemaImport.getNamespace());
        XmlSchema schema2 = schemaImport.getSchema();
View Full Code Here

    public WSDLASTVisitor(String tns)
        throws WSDLException, JAXBException {
       
        createWsdlDefinition(tns);
       
        schemas = new XmlSchemaCollection();
        schema = new XmlSchema(definition.getTargetNamespace(), schemas);
       
        addAnyType();
       
        createCorbaTypeMap();
View Full Code Here

        definition = manager.createWSDLDefinition(tns);
       
        inheritScopeMap = new TreeMap<Scope, List<Scope>>();

        targetNamespace = tns;
        schemas = new XmlSchemaCollection();
        scopedNames = new ScopeNameCollection();
        deferredActions = new DeferredActionCollection();

        if (schemans == null) {
            schemans = tns;
View Full Code Here

    }
   
    private XmlSchemaCollection schemaCollection;
   
    public SchemaCollection() {
        this(new XmlSchemaCollection());
    }
View Full Code Here

public class CommonsXsdSchemaTest extends AbstractXsdSchemaTestCase {

    @Override
    protected XsdSchema createSchema(Resource resource) throws Exception {
        XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
        XmlSchema schema = schemaCollection.read(SaxUtils.createInputSource(resource));
        return new CommonsXsdSchema(schema);
    }
View Full Code Here

        wsdlInterface.setUnresolved(false);
        wsdlInterface.setRemotable(true);
        PortType portType = (PortType)def.getAllPortTypes().values().iterator().next();
        wsdlInterface.setPortType(portType);

        readInlineSchemas(wsdlFactory, wsdlDefinition, def, new XmlSchemaCollection());

        try {
            for (Operation op : iface.getOperations()) {
                javax.wsdl.Operation wsdlOp = portType.getOperation(op.getName(), null, null);
                WSDLOperationIntrospectorImpl opx =
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.schema.XmlSchemaCollection

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.