Package javax.wsdl.extensions.schema

Examples of javax.wsdl.extensions.schema.Schema


                        // a remote location.
                        if (!namespaces.contains(typeNamespace)
                            && typeNamespace.equals(ReferenceConstants.WSADDRESSING_NAMESPACE)) {
                           
                            // build up the ws-addressing schema import
                            Schema wsdlSchema =
                                (Schema)def.getExtensionRegistry().createExtension(Types.class,
                                                     new QName(Constants.URI_2001_SCHEMA_XSD, "schema"));
                            SchemaImport schemaimport =  wsdlSchema.createImport();
                            schemaimport.setNamespaceURI(ReferenceConstants.WSADDRESSING_NAMESPACE);
                            schemaimport.setSchemaLocationURI(ReferenceConstants.WSADDRESSING_LOCATION);
                            wsdlSchema.addImport(schemaimport);
                           
                            // add the import and the prefix to the definition
                            def.getTypes().addExtensibilityElement(wsdlSchema);
                            CastUtils.cast(def.getNamespaces(), String.class, String.class)
                                .put(ReferenceConstants.WSADDRESSING_PREFIX, typeNamespace);
View Full Code Here


        Types types = def.getTypes();
        if (types != null) {
            for (ExtensibilityElement el
                : CastUtils.cast((List)types.getExtensibilityElements(), ExtensibilityElement.class)) {
                if (el instanceof Schema) {
                    Schema see = (Schema)el;
                    updateSchemaImports(see, doneSchemas, base);
                }
            }
        }
    }   
View Full Code Here

        Types types = def.getTypes();
        if (types != null) {
            for (ExtensibilityElement el
                : CastUtils.cast(types.getExtensibilityElements(), ExtensibilityElement.class)) {
                if (el instanceof Schema) {
                    Schema see = (Schema)el;
                    updateSchemaImports(bus, see, see.getDocumentBaseURI(), doneSchemas, base);
                }
            }
        }
    }
View Full Code Here

                    schema.setAttribute("elementFormDefault", "unqualified");
                    schema.setAttribute("attributeFormDefault", "qualified");
                    schema.setAttribute("targetNamespace", targetNS);
                    schema.setAttributeNS(XMLNS_NS, "xmlns:xs", SCHEMA_NS);
                    schemaDoc.appendChild(schema);
                    Schema schemaExt = createSchemaExt(definition);
                    schemaExt.setElement(schema);
                    prefixMaps.put(schema, new HashMap<String, String>());
                    xsDef = xsdFactory.createXSDefinition();
                    xsDef.setUnresolved(true);
                    xsDef.setNamespace(targetNS);
                    xsDef.setDocument(schemaDoc);
View Full Code Here

                }
            }
            loadXSD(schemaCollection, xsDef);
            wsdlDefinition.getXmlSchemas().add(xsDef);
            Element schema = document.getDocumentElement();
            Schema schemaExt = createSchemaExt(definition);
            schemaExt.setDocumentBaseURI(document.getDocumentURI());
            schemaExt.setElement(schema);
        }
    }
View Full Code Here

        if (types == null) {
            types = definition.createTypes();
            definition.setTypes(types);
        }

        Schema schemaExt = createSchema(definition);
        types.addExtensibilityElement(schemaExt);

        return schemaExt;
    }
View Full Code Here

        Types types = def.getTypes();
        if (types != null) {
            for (ExtensibilityElement el
                : CastUtils.cast((List)types.getExtensibilityElements(), ExtensibilityElement.class)) {
                if (el instanceof Schema) {
                    Schema see = (Schema)el;
                    updateSchemaImports(see, doneSchemas, base);
                }
            }
        }
    }   
View Full Code Here

            ArrayList<String> dependencies) throws RegistryException {
        baseURI = wsdlDocumentBaseURI;
        /* evaluating schemas found under wsdl:types tag in a wsdl */
        if (types != null) {
            List extensibleElements = types.getExtensibilityElements();
            Schema schemaExtension;     
            Object extensionObject;
            XmlSchema xmlSchema;
            XmlSchemaCollection xmlSchemaCollection;
            wsdlDocumentBaseURI = wsdlDocumentBaseURI.substring(0, wsdlDocumentBaseURI.lastIndexOf("/") + 1);
            for (Object extensibleElement : extensibleElements) {
                extensionObject = extensibleElement;
                if (extensionObject instanceof Schema) {
                    schemaExtension = (Schema)extensionObject;
                    xmlSchemaCollection = new XmlSchemaCollection();
                    /* setting base URI in the collection to load relative schemas */
                    xmlSchemaCollection.setBaseUri(wsdlDocumentBaseURI);
                    xmlSchema = xmlSchemaCollection.read(schemaExtension.getElement());
                    evaluateSchemasRecursively(xmlSchema, dependencies, true, false);
                }
            }
        }
    }
View Full Code Here

     * PopulatedExtensionRegistry registers SchemaDeserializer by default, but
     * if the user chooses not to register a suitable deserializer then the
     * UnknownDeserializer will be used, returning an UnknownExtensibilityElement.
     */

    Schema schema = null;
    SchemaReference schemaRef = null;
    try
    {

      QName elementType = QNameUtils.newQName(el);

     ExtensionDeserializer exDS =
       extReg.queryDeserializer(parentType, elementType);

      //Now unmarshall the DOM element.
     ExtensibilityElement ee =
        exDS.unmarshall(parentType, elementType, el, def, extReg);

     if (ee instanceof Schema)
     {
       schema = (Schema) ee;
     }
     else
     {
       //Unknown extensibility element, so don't do any more schema parsing on it.
       return ee;
     }


      //Keep track of parsed schemas to avoid duplicating Schema objects
     //through duplicate or circular references (eg: A imports B imports A).
     if (schema.getDocumentBaseURI() != null)
     {
       this.allSchemas.put(schema.getDocumentBaseURI(), schema);
     }

      //At this point, any SchemaReference objects held by the schema will not
      //yet point to their referenced schemas, so we must now retrieve these
      //schemas and set the schema references.

      //First, combine the schema references for imports, includes and redefines
      //into a single list

      ArrayList allSchemaRefs = new ArrayList();

      Collection ic = schema.getImports().values();
      Iterator importsIterator = ic.iterator();
      while(importsIterator.hasNext())
      {
        allSchemaRefs.addAll( (Collection) importsIterator.next() );
      }

      allSchemaRefs.addAll(schema.getIncludes());
      allSchemaRefs.addAll(schema.getRedefines());

      //Then, retrieve the schema referred to by each schema reference. If the
      //schema has been read in previously, use the existing schema object.
      //Otherwise unmarshall the DOM element into a new schema object.

      ListIterator schemaRefIterator = allSchemaRefs.listIterator();

      while(schemaRefIterator.hasNext())
      {
        try
        {
          schemaRef = (SchemaReference) schemaRefIterator.next();

          if (schemaRef.getSchemaLocationURI() == null)
          {
            //cannot get the referenced schema, so ignore this schema reference
            continue;
          }

          if (verbose)
          {
            System.out.println("Retrieving schema at '" +
                               schemaRef.getSchemaLocationURI() +
                              (schema.getDocumentBaseURI() == null
                               ? "'."
                               : "', relative to '" +
                               schema.getDocumentBaseURI() + "'."));
          }


          InputStream inputStream = null;
          InputSource inputSource = null;

          //This is the child schema referred to by the schemaReference
          Schema referencedSchema = null;

          //This is the child schema's location obtained from the WSDLLocator or the URL
          String location = null;

          if (loc != null)
View Full Code Here

      // Getting the list of wsdl:schemaS
      List extElems = types.getExtensibilityElements();
      for (int i = 0; i < extElems.size(); i++)
      {
        // Getting wsdl:schema element
        Schema schema =
          (Schema) extElems.get(i);
        // Getting a value of the attribute xmlns:xml
        String attrValue = schema.getElement().getAttributeNS(
          WSIConstants.NS_URI_XMLNS, "xml");
        // If it equals to "http://www.w3.org/XML/1998/namespace",
        if (WSIConstants.NS_URI_XML.equals(attrValue))
        {
          // setting assertion result to warning
View Full Code Here

TOP

Related Classes of javax.wsdl.extensions.schema.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.