Examples of InlinedSchema


Examples of org.apache.woden.schema.InlinedSchema

      fInterfaceElement.setName(new NCName("interfaceName"));
      fServiceElement = fDescriptionElement.addServiceElement();
      fServiceElement.setName(new NCName("serviceName"));

        //Create a test schema
        InlinedSchema schema = new InlinedSchemaImpl();
        XmlSchema xs1 = null;
        URI schemaNS = null;

        String schemaString = "<schema xmlns=\"http://www.w3.org/2001/XMLSchema\">"
                    + "<element  name=\"myEd\" type=\"string\"/>"
                    + "<complexType name=\"myTypeDef\">"    
                    + "<sequence>"    
                    + "<element name=\"element\" type=\"string\"/>"     
                    + "</sequence>"    
                    + "</complexType>"
                    + "</schema>";
       
        DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        DocumentBuilder builder = dbf.newDocumentBuilder();
        Reader reader = new StringReader(schemaString);
        InputSource is = new InputSource(reader);
        Document schemaDoc1 = null;
        try {
            schemaDoc1 = builder.parse(is);
        } catch(IOException e) {
            fail("There was an IOException whilst trying to parse the sample schema.");
        }
       
        XmlSchemaCollection xsc = new XmlSchemaCollection();
        xs1 = xsc.read(schemaDoc1.getDocumentElement());
        schema.setSchemaDefinition(xs1);
     
        //Add it to the typesElement.
        TypesElement typesEl = fDescriptionElement.addTypesElement();
        typesEl.addSchema(schema);
       
View Full Code Here

Examples of org.apache.woden.schema.InlinedSchema

        retrievedElement = messageReference.getXmlSchemaElement();
        assertNull("Should return null if 'element' attribute is #other", retrievedElement);

        // Case 4 - (with 'element' set to the qname of a schema element declaration)
        TypesElement typesElement = descriptionElement.addTypesElement()//throws WSDLException
        InlinedSchema schema = new InlinedSchemaImpl();
        String schemaString = "<schema xmlns=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"http://www.sample.org\">"
                  + "<complexType name=\"myType\">"    
                  + "<sequence>"    
                  + "<element  name=\"element\" type=\"string\"/>"     
                  + "</sequence>"    
                  + "</complexType>"
                  + "<element name=\"myElement\" type=\"string\"/>"
                  + "</schema>";
        DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        DocumentBuilder builder = dbf.newDocumentBuilder();
        Reader reader = new StringReader(schemaString);
        InputSource is = new InputSource(reader);      
        Document schemaDoc1 = builder.parse(is);
        XmlSchemaCollection xsc = new XmlSchemaCollection();
        XmlSchema xs1 = xsc.read(schemaDoc1.getDocumentElement());
        schema.setSchemaDefinition(xs1);
        URI schemaNS = URI.create("http://www.sample.org");
        schema.setNamespace(schemaNS);
        typesElement.addSchema(schema);
       
        QName elemQN = new QName("http://www.sample.org","myElement");
        XmlSchemaElement expectedElement = xs1.getElementByName(elemQN);
       
View Full Code Here

Examples of org.apache.woden.schema.InlinedSchema

        retrievedElement = faultElement.getXmlSchemaElement();
        assertNull("Should return null if 'element' attribute is #other", retrievedElement);

        // Case 4 - (with 'element' set to the qname of a schema element declaration)
        TypesElement typesElement = descriptionElement.addTypesElement()//throws WSDLException
        InlinedSchema schema = new InlinedSchemaImpl();
        String schemaString = "<schema xmlns=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"http://www.sample.org\">"
                  + "<complexType name=\"myType\">"    
                  + "<sequence>"    
                  + "<element  name=\"element\" type=\"string\"/>"     
                  + "</sequence>"    
                  + "</complexType>"
                  + "<element name=\"myElement\" type=\"string\"/>"
                  + "</schema>";
        DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        DocumentBuilder builder = dbf.newDocumentBuilder();
        Reader reader = new StringReader(schemaString);
        InputSource is = new InputSource(reader);
        Document schemaDoc1 = builder.parse(is);
        XmlSchemaCollection xsc = new XmlSchemaCollection();
        XmlSchema xs1 = xsc.read(schemaDoc1.getDocumentElement());
        schema.setSchemaDefinition(xs1);
        URI schemaNS = URI.create("http://www.sample.org");
        schema.setNamespace(schemaNS);
        typesElement.addSchema(schema);
       
        QName elemQN = new QName("http://www.sample.org","myElement");
        XmlSchemaElement expectedElement = xs1.getElementByName(elemQN);
       
View Full Code Here

Examples of org.apache.woden.schema.InlinedSchema

  boolean isValid = true;
  int numInlineSchemas = schema.length;
  Hashtable schemas = new Hashtable();
  for(int i = 0; i < numInlineSchemas; i++)
  {
    InlinedSchema iSchema = schema[i];
    URI iSchemaNs = iSchema.getNamespace();
    // If the namespace isn't defined this assertion doesn't apply.
    if(iSchemaNs == null)
    continue;
    String ns = iSchemaNs.toString();
   
    if(schemas.containsKey(ns))
    {
    List schemaList = (List)schemas.get(ns);
    XmlSchemaObjectTable elements = iSchema.getSchemaDefinition().getElements();
    Iterator elementNames = elements.getNames();
    while(elementNames.hasNext())
    {
      QName elementName = (QName)elementNames.next();
      Iterator otherInlineSchemas = schemaList.iterator();
      while(otherInlineSchemas.hasNext())
      {
      if(((InlinedSchema)otherInlineSchemas.next()).getSchemaDefinition().getElementByName(elementName) != null)
      {
        // Duplicate element defined.
        errorReporter.reportError(new ErrorLocatorImpl(), "Schema-1073", new Object[]{elementName, ns}, ErrorReporter.SEVERITY_ERROR);
        isValid = false;
      }
      }
   
    }
   
    XmlSchemaObjectTable types = iSchema.getSchemaDefinition().getSchemaTypes();
    Iterator typeNames = types.getNames();
    while(typeNames.hasNext())
    {
      QName typeName = (QName)typeNames.next();
      Iterator otherInlineSchemas = schemaList.iterator();
View Full Code Here

Examples of org.apache.woden.schema.InlinedSchema

            xs=inlinedSchema[i].getSchemaDefinition();
            xs.write(pw);
        }*/

      for(int i=0;i<inlinedSchema.length;i++){
        InlinedSchema schema=inlinedSchema[i];
        XMLElement ele=schema.getXMLElement();
        DOM2Writer.serializeAsXML(((Node)ele.getSource()), pw);

      }
    }
View Full Code Here

Examples of org.apache.woden.schema.InlinedSchema

         * elementFormDefault="unqualified" ..etc for(int i=0;i<inlinedSchema.length;i++){
         * xs=inlinedSchema[i].getSchemaDefinition(); xs.write(pw); }
         */

        for (int i = 0; i < inlinedSchema.length; i++) {
            InlinedSchema schema = inlinedSchema[i];
            XMLElement ele = schema.getXMLElement();         
            OMWriter.serializeAsXML((OMNode)ele.getSource(), pw);

        }
      
    }
View Full Code Here

Examples of org.apache.woden.schema.InlinedSchema

        // Default case
        assertNull("When 'element' attribute is omitted, no ElementDeclaration should be present", msgRef.getElementDeclaration());
       
        // Test that the expected ElementDeclaration is returned
        TypesElement typesElement = fDescriptionElement.addTypesElement()//throws WSDLException
        InlinedSchema schema = new InlinedSchemaImpl();
        String schemaString = "<schema xmlns=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"http://www.sample.org\">"
                  + "<complexType name=\"myType\">"    
                  + "<sequence>"    
                  + "<element  name=\"element\" type=\"string\"/>"     
                  + "</sequence>"    
                  + "</complexType>"
                  + "<element name=\"myElement\" type=\"string\"/>"
                  + "</schema>";
        DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        DocumentBuilder builder = dbf.newDocumentBuilder();
        Reader reader = new StringReader(schemaString);
        InputSource is = new InputSource(reader);       
        Document schemaDoc1 = builder.parse(is);
        XmlSchemaCollection xsc = new XmlSchemaCollection();
        XmlSchema xs1 = xsc.read(schemaDoc1.getDocumentElement());
        schema.setSchemaDefinition(xs1);
        URI schemaNS = URI.create("http://www.sample.org");
        schema.setNamespace(schemaNS);
        typesElement.addSchema(schema);
       
        QName elemQN = new QName("http://www.sample.org","myElement");
       
        fMessageReferenceElement.setElement(new QNameTokenUnion(elemQN));
View Full Code Here

Examples of org.apache.woden.schema.InlinedSchema

        // Default case
        assertNull("When 'element' attribute is omitted, no ElementDeclaration should be present", fault.getElementDeclaration());
       
        // Test that the expected ElementDeclaration is returned
        TypesElement typesElement = fDescriptionElement.addTypesElement()//throws WSDLException
        InlinedSchema schema = new InlinedSchemaImpl();
        String schemaString = "<schema xmlns=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"http://www.sample.org\">"
                  + "<complexType name=\"myType\">"    
                  + "<sequence>"    
                  + "<element  name=\"element\" type=\"string\"/>"     
                  + "</sequence>"    
                  + "</complexType>"
                  + "<element name=\"myElement\" type=\"string\"/>"
                  + "</schema>";
        DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        DocumentBuilder builder = dbf.newDocumentBuilder();
        Reader reader = new StringReader(schemaString);
        InputSource is = new InputSource(reader);      
        Document schemaDoc1 = builder.parse(is);
        XmlSchemaCollection xsc = new XmlSchemaCollection();
        XmlSchema xs1 = xsc.read(schemaDoc1.getDocumentElement());
        schema.setSchemaDefinition(xs1);
        URI schemaNS = URI.create("http://www.sample.org");
        schema.setNamespace(schemaNS);
        typesElement.addSchema(schema);
       
        QName elemQN = new QName("http://www.sample.org","myElement");
       
        fFaultElement.setElement(new QNameTokenUnion(elemQN));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.