Package org.apache.ws.commons.schema

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


    @Test
    public void testAegisTypeSchema() throws Exception {
        AegisContext context = new AegisContext();
        context.initialize();
        XmlSchemaCollection collection = new XmlSchemaCollection();
        context.addTypesSchemaDocument(collection);
        XmlSchema[] schemas = collection.getXmlSchemas();
        XmlSchema typeSchema = null;
        for (XmlSchema schema : schemas) {
            if (AegisContext.UTILITY_TYPES_SCHEMA_NS.equals(schema.getTargetNamespace())) {
                typeSchema = schema;
                break;
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

        Types types = newDef.getTypes();
        assertNotNull(types);
        Collection<ExtensibilityElement> schemas =
            CastUtils.cast(types.getExtensibilityElements(), ExtensibilityElement.class);
        assertEquals(1, schemas.size());
        XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
        Element schemaElem = ((Schema)schemas.iterator().next()).getElement();
        XmlSchema newSchema = schemaCollection.read(schemaElem);
        assertEquals("http://apache.org/hello_world_soap_http/types",
                     newSchema.getTargetNamespace()
                     );
    }
View Full Code Here

    private XmlSchemaCollection schemaCollection;
    private Map<XmlSchema, Set<XmlSchemaType>> xmlTypesCheckedForCrossImportsPerSchema
        = new HashMap<XmlSchema, Set<XmlSchemaType>>();

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

    private Map<XmlSchema, Set<XmlSchemaType>> xmlTypesCheckedForCrossImportsPerSchema
        = new HashMap<XmlSchema, Set<XmlSchemaType>>();


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

        */                                                                     

        QName TYPE_QNAME = new QName("http://soapinterop.org/types",
                                     "dietdrinksize");
        InputStream is = new FileInputStream(Resources.asURI("screstriction.xsd"));
        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        XmlSchema schema = schemaCol.read(new StreamSource(is), null);

        XmlSchemaComplexType xsct =
            (XmlSchemaComplexType)schema.getTypeByName(TYPE_QNAME);
        assertNotNull(xsct);

View Full Code Here

        */                                                                     

        QName ELEMENT_QNAME = new QName("http://soapinterop.org/types",
                                        "height");
        InputStream is = new FileInputStream(Resources.asURI("simplecontentextension.xsd"));
        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        XmlSchema schema = schemaCol.read(new StreamSource(is), null);

        XmlSchemaElement elem = schema.getElementByName(ELEMENT_QNAME);
        assertNotNull(elem);
        assertEquals("height", elem.getName());
        assertEquals(new QName("http://soapinterop.org/types", "height"),
View Full Code Here

        binding.setUndefined(false);
        definition.addBinding(binding);
        wsdlDefinition.setBinding(binding);

        // call each helper in turn to populate the wsdl.types element
        XmlSchemaCollection schemaCollection = new XmlSchemaCollection();

        for (Map.Entry<XMLTypeHelper, List<DataType>> en: getDataTypes(interfaze, false, helpers).entrySet()) {
            XMLTypeHelper helper = en.getKey();
            if (helper == null) {
                continue;
View Full Code Here

    public String putSchemaToRegistry( RequestContext requestContext,
                                       String resourcePath,
                                       String commonLocation,
                                       boolean processIncludes) throws RegistryException {
        resourceName = resourcePath.substring(resourcePath.lastIndexOf(RegistryConstants.PATH_SEPARATOR) + 1);
        XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection();
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream((byte[])requestContext.getResource().getContent());
        InputSource inputSource = new InputSource(byteArrayInputStream);
        String url = "http://this.schema.needs/a/valid/source/url/to/proceed.xsd";

        try {
            XmlSchema xmlSchema = xmlSchemaCollection.read(inputSource, null);
            xmlSchema.setSourceURI(url);
            evaluateSchemasRecursively(xmlSchema, null, false, true);
        } catch (RuntimeException re) {
            String msg = "Could not read the XML Schema Definition file. ";
            if (re.getCause() instanceof org.apache.ws.commons.schema.XmlSchemaException) {
View Full Code Here

                                       String resourcePath,
                                       String commonLocation,
                                       boolean processIncludes) throws RegistryException {
        resourceName = resourcePath.substring(resourcePath.lastIndexOf(RegistryConstants.PATH_SEPARATOR) + 1);
        String url = requestContext.getSourceURL();
        XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection();
        xmlSchemaCollection.setBaseUri(url);
        baseURI = url;
        InputSource inputSource = new InputSource(url);

        try {
            // Here we assue schema is correct. Schema validation is beyond our scope, so we don't
            // bother with a ValidationEventHandler.
            XmlSchema xmlSchema = xmlSchemaCollection.read(inputSource, null);
            evaluateSchemasRecursively(xmlSchema, null, false, true);
        } catch (RuntimeException re) {
            String msg = "Could not read the XML Schema Definition file. ";
            if (re.getCause() instanceof org.apache.ws.commons.schema.XmlSchemaException) {
                msg += re.getCause().getMessage();
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.