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

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


            xmlSchema.setElementFormDefault(getElementFormDefaultSetting());

            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


    }
  }

  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

                return null;
            }

            // setting target name space
            axisService.setTargetNamespace(wsdl4jDefinition.getTargetNamespace());
            axisService.setNamespaceMap(new NamespaceMap(wsdl4jDefinition.getNamespaces()));
           
            Map importsMap = wsdl4jDefinition.getImports();
           
            if (importsMap != null) {
                List imports = new ArrayList(importsMap.keySet());
View Full Code Here

        org.xml.sax.InputSource schemaInputSource = new InputSource(new StringReader(schema));
        XmlSchemaCollection xsc = new XmlSchemaCollection();
        xsc.setBaseUri(Resources.TEST_RESOURCES);

        //Set the namespaces explicitly
        NamespaceMap prefixmap = new NamespaceMap(namespaceMapFromWSDL);
        xsc.setNamespaceContext(prefixmap);
        XmlSchema schemaDef = xsc.read(schemaInputSource, null);
        StringWriter sw = new StringWriter();
        schemaDef.write(sw);
               
View Full Code Here

                this.description = description;

            }
            // Create the namespacemap

            stringBasedNamespaceMap = new NamespaceMap();
            for (int i = 0; i < namespacemap.length; i++) {
                NamespaceDeclaration namespaceDeclaration = namespacemap[i];
                stringBasedNamespaceMap.put(namespaceDeclaration.getPrefix(),
                                            namespaceDeclaration.getNamespaceURI().toString());
            }
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

        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


            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

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.