Package org.apache.ws.commons.schema.utils

Examples of org.apache.ws.commons.schema.utils.NamespaceMap


        } else {
            String nsURI = xsDef.getNamespace();
            Document document = xsDef.getDocument();
            if (document == null) {
                try {
                    NamespaceMap prefixMap = new NamespaceMap();
                    prefixMap.add("xs", SCHEMA_NS);
                    prefixMap.add("tns", nsURI);
                    XmlSchema schemaDef = xsDef.getSchema();
                    schemaDef.setNamespaceContext(prefixMap);
                    Document[] docs = schemaDef.getAllSchemas();
                    document = docs[docs.length-1];
                    document.setDocumentURI(xsDef.getLocation().toString());
View Full Code Here


        Map<String, String> explicitNamespaceMappings = this.getDataBinding().getDeclaredNamespaceMappings();
        if (explicitNamespaceMappings == null) {
            explicitNamespaceMappings = Collections.emptyMap();
        }
        NamespaceMap nsMap = new NamespaceMap();
        for (Map.Entry<String, String> mapping : explicitNamespaceMappings.entrySet()) {
            nsMap.add(mapping.getValue(), mapping.getKey());
        }

        if (!explicitNamespaceMappings.containsKey(WSDLConstants.NS_SCHEMA_XSD)) {
            nsMap.add(WSDLConstants.NP_SCHEMA_XSD, WSDLConstants.NS_SCHEMA_XSD);
        }
        if (!explicitNamespaceMappings.containsKey(serviceInfo.getTargetNamespace())) {
            nsMap.add(WSDLConstants.CONVENTIONAL_TNS_PREFIX, serviceInfo.getTargetNamespace());
        }
        schema.setNamespaceContext(nsMap);
        serviceInfo.addSchema(schemaInfo);
        return schemaInfo;
    }
View Full Code Here

                axisService.setName(serviceName);
                axisService.setTargetNamespace(targetNamespace);
              //  axisService.setScope(serviceScope);

                // adding name spaces
                NamespaceMap map = new NamespaceMap();
                map.put(Java2WSDLConstants.AXIS2_NAMESPACE_PREFIX, Java2WSDLConstants.AXIS2_XSD);
                map.put(Java2WSDLConstants.DEFAULT_SCHEMA_NAMESPACE_PREFIX,
                        Java2WSDLConstants.URI_2001_SCHEMA_XSD);
                axisService.setNameSpacesMap(map);
                String schemaTargetNamespace = "http://services.mashup.wso2.org/" + serviceName + "?xsd";
               /* String schemaString = "<xs:schema targetNamespace=\""
                        + schemaTargetNamespace
View Full Code Here

   */
  private static XmlSchema retrieveSchema(CommonParams cparams, String namespace) {
    Map<String, XmlSchema> schemaMap = cparams.getSchemaMap();
    if (!schemaMap.containsKey(namespace)) {
      XmlSchema schema = new XmlSchema(namespace, cparams.getXmlSchemaCollection());
      schema.setNamespaceContext(new NamespaceMap());
      schemaMap.put(namespace, schema);
      schema.setElementFormDefault(new XmlSchemaForm(XmlSchemaForm.QUALIFIED));
      schema.setAttributeFormDefault(new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED));
    }
    return schemaMap.get(namespace);
View Full Code Here

    }
  }

  private XmlSchema addNameSpaces(int i) {
    XmlSchema schema = (XmlSchema) schemaList.get(i);
    NamespaceMap map = (NamespaceMap) namespaceMap.clone();
    NamespacePrefixList namespaceContext = schema.getNamespaceContext();
    String prefixes[] = namespaceContext.getDeclaredPrefixes();
    for (int j = 0; j < prefixes.length; j++) {
      String prefix = prefixes[j];
      map.add(prefix, namespaceContext.getNamespaceURI(prefix));
    }
    schema.setNamespaceContext(map);
    return schema;
  }
View Full Code Here

    axisService.setUseDefaultChains(false);
    axisService.addParameter(parameter);
    axisService.setName(serviceName);
    axisService.setClassLoader(loader);

    NamespaceMap map = new NamespaceMap();
    map.put(Java2WSDLConstants.AXIS2_NAMESPACE_PREFIX,
        Java2WSDLConstants.AXIS2_XSD);
    map.put(Java2WSDLConstants.DEFAULT_SCHEMA_NAMESPACE_PREFIX,
        Java2WSDLConstants.URI_2001_SCHEMA_XSD);
    axisService.setNamespaceMap(map);
    Utils.processBeanPropertyExclude(axisService);
    axisService.setElementFormDefault(false);
    try {
View Full Code Here

  private void addSchemaNameSpace(XmlSchema schema) {
    String targetNameSpace = schema.getTargetNamespace();
    String prefix = schema.getNamespaceContext().getPrefix(targetNameSpace);

    if (namespaceMap == null) {
      namespaceMap = new NamespaceMap();
    }

    if (!namespaceMap.values().contains(targetNameSpace)) {
      // i.e this target namespace not exists in the namesapce map
      // find a non exists prefix to add this target namesapce
View Full Code Here

   * Creates a schema from a DataService object, to be used later in WSDL generation.
   */
  @SuppressWarnings ("unchecked")
  private void createDSSchema(AxisService axisService, DataService dataService)
      throws DataServiceFault {
    NamespaceMap map = new NamespaceMap();
    map.put(Java2WSDLConstants.DEFAULT_SCHEMA_NAMESPACE_PREFIX,
        Java2WSDLConstants.URI_2001_SCHEMA_XSD);
    axisService.setNamespaceMap(map);
    DataServiceDocLitWrappedSchemaGenerator.populateServiceSchema(axisService);
  }
View Full Code Here


            targetNamespacePrefixMap.put(targetNamespace, targetNamespacePrefix);
            schemaMap.put(targetNamespace, xmlSchema);

            NamespaceMap prefixmap = new NamespaceMap();
            prefixmap.put(DEFAULT_SCHEMA_NAMESPACE_PREFIX, URI_2001_SCHEMA_XSD);
            prefixmap.put(targetNamespacePrefix, targetNamespace);
            xmlSchema.setNamespaceContext(prefixmap);
        }
        return xmlSchema;
    }
View Full Code Here

        if (serviceClass == null) {
            return;
        }
        ClassLoader serviceClassLoader = axisService.getClassLoader();
        // adding name spaces
        NamespaceMap map = new NamespaceMap();
        map.put(Java2WSDLConstants.AXIS2_NAMESPACE_PREFIX,
                Java2WSDLConstants.AXIS2_XSD);
        map.put(Java2WSDLConstants.DEFAULT_SCHEMA_NAMESPACE_PREFIX,
                Java2WSDLConstants.URI_2001_SCHEMA_XSD);
        axisService.setNamespaceMap(map);
        SchemaGenerator schemaGenerator;
        Parameter generateBare = axisService
                .getParameter(Java2WSDLConstants.DOC_LIT_BARE_PARAMETER);
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.schema.utils.NamespaceMap

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.