Package javax.wsdl.extensions.schema

Examples of javax.wsdl.extensions.schema.Schema


    // adjust the schema locations in types section
    Types types = definition.getTypes();
    if (types != null) {
      List extensibilityElements = types.getExtensibilityElements();
      Object extensibilityElement = null;
      Schema schema = null;
      for (Iterator iter = extensibilityElements.iterator(); iter.hasNext();) {
        extensibilityElement = iter.next();
        if (extensibilityElement instanceof Schema) {
          schema = (Schema) extensibilityElement;
          changeLocations(schema.getElement());
        }
      }
    }
   
    Iterator iter = definition.getImports().values().iterator();
View Full Code Here


            return packageList;
        }
        List extensibilityElements = types.getExtensibilityElements();
        for (Object obj : extensibilityElements) {
            if (obj != null && isSchema((ExtensibilityElement)obj)) {
                Schema schema = (Schema)obj;
                //process schemas and read packages from them.
                processSchema(schema, schemaList, packageList);
            }
        }
View Full Code Here

    }

    private void processImport(SchemaImport si, List<Schema> schemaList, Set<String> packageList)
            throws SchemaReaderException {
        Schema refSchema = si.getReferencedSchema();
        if (refSchema != null) {
            processSchema(refSchema, schemaList, packageList);
        }
    }
View Full Code Here

                if (description instanceof AxisEndpoint) {
                  setEndpointURL((AxisEndpoint) description, httpAddress.getLocationURI());
                }

            } else if (wsdl4jExtensibilityElement instanceof Schema) {
                Schema schema = (Schema) wsdl4jExtensibilityElement;
                // just add this schema - no need to worry about the imported
                // ones
                axisService.addSchema(getXMLSchema(schema.getElement(), schema
                        .getDocumentBaseURI()));

            } else if (wsdl4jExtensibilityElement instanceof SOAP12Operation) {
                SOAP12Operation soapOperation = (SOAP12Operation) wsdl4jExtensibilityElement;
                AxisBindingOperation axisBindingOperation = (AxisBindingOperation) description;
View Full Code Here

                if (null != required) {
                    soapAddressExtensibilityElement.setRequired(required.booleanValue());
                }
                component.addExtensibilityElement(soapAddressExtensibilityElement);
            } else if (wsdl4jElement instanceof Schema) {
                Schema schema = (Schema) wsdl4jElement;
//schema.getDocumentBaseURI()
//populate the imported schema stack
                Stack schemaStack = new Stack();
//recursivly load the schema elements. The best thing is to push these into
//a stack and then pop from the other side
                pushSchemaElement(schema, schemaStack);
                org.apache.wsdl.extensions.Schema schemaExtensibilityElement = (org.apache.wsdl.extensions.Schema) extensionFactory.getExtensionElement(
                        schema.getElementType());
                schemaExtensibilityElement.setElement(schema.getElement());
                schemaExtensibilityElement.setImportedSchemaStack(schemaStack);
                Boolean required = schema.getRequired();
                if (null != required) {
                    schemaExtensibilityElement.setRequired(required.booleanValue());
                }
                //set the name of this Schema element
                //todo this needs to be fixed
                if(schema.getDocumentBaseURI() != null) {
                    schemaExtensibilityElement.setName(new QName("",schema.getDocumentBaseURI()));
                }
                component.addExtensibilityElement(schemaExtensibilityElement);
            } else if (SOAPConstants.Q_ELEM_SOAP_OPERATION.equals(
                    wsdl4jElement.getElementType())) {
                SOAPOperation soapOperation = (SOAPOperation) wsdl4jElement;
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

                    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

        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(bus, see, doneSchemas, base);
                }
            }
        }
    }   
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(bus, see, doneSchemas, base);
                }
            }
        }
    }   
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.