Java Code Examples for javax.wsdl.Definition#getNamespaces()

The following examples show how to use javax.wsdl.Definition#getNamespaces() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SoapProtocol.java    From jolie with GNU Lesser General Public License v2.1 6 votes vote down vote up
private void parseWSDLTypes( XSOMParser schemaParser )
	throws IOException {
	Definition definition = getWSDLDefinition();
	if( definition != null ) {
		Types types = definition.getTypes();
		if( types != null ) {
			List< ExtensibilityElement > list = types.getExtensibilityElements();
			for( ExtensibilityElement element : list ) {
				if( element instanceof SchemaImpl ) {
					Element schemaElement = ((SchemaImpl) element).getElement();
					Map< String, String > namespaces = definition.getNamespaces();
					for( Entry< String, String > entry : namespaces.entrySet() ) {
						if( entry.getKey().equals( "xmlns" ) || entry.getKey().trim().isEmpty() ) {
							continue;
						}
						if( schemaElement.getAttribute( "xmlns:" + entry.getKey() ).isEmpty() ) {
							schemaElement.setAttribute( "xmlns:" + entry.getKey(), entry.getValue() );
						}
					}
					parseSchemaElement( definition, schemaElement, schemaParser );
				}
			}
		}
	}
}
 
Example 2
Source File: WsdlTypes.java    From hop with Apache License 2.0 5 votes vote down vote up
/**
 * Create a new for WsdlTypes instance for the specified WSDL definition.
 *
 * @param wsdlDefinition The WSDL definition.
 */
@SuppressWarnings( "unchecked" )
protected WsdlTypes( Definition wsdlDefinition ) {

  _types = wsdlDefinition.getTypes();
  _targetNamespace = wsdlDefinition.getTargetNamespace();
  _prefixMappings = wsdlDefinition.getNamespaces();
  _elementFormQualifiedNamespaces = new HashSet<String>( getElementFormQualifiedNamespaces() );
  _namedComplexTypes = new WsdlComplexTypes( this );
}
 
Example 3
Source File: BaseNodeAdapter.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
private void setNamespacePrefixes(Definition definition) {
      if (definition == null || definition.getNamespaces() == null) {
          return;
      }

      Collection namespaces = definition.getNamespaces().values();
      if (namespaces == null) {
          return;
      }

      if (!namespaces.contains("http://schemas.xmlsoap.org/wsdl/http/")) {
          definition.addNamespace("http", "http://schemas.xmlsoap.org/wsdl/http/");
      }
      if (!namespaces.contains("http://schemas.xmlsoap.org/wsdl/mime/")) {
          definition.addNamespace("mime", "http://schemas.xmlsoap.org/wsdl/mime/");
      }
      if (!namespaces.contains("http://schemas.xmlsoap.org/wsdl/soap/")) {
          definition.addNamespace("soap", "http://schemas.xmlsoap.org/wsdl/soap/");
}
      if (!namespaces.contains("http://schemas.xmlsoap.org/wsdl/soap/")) {
          definition.addNamespace("soap", "http://schemas.xmlsoap.org/wsdl/soap/");
      }
      if (!namespaces.contains("http://schemas.xmlsoap.org/wsdl/soap12/")) {
          definition.addNamespace("soap12", "http://schemas.xmlsoap.org/wsdl/soap12/");
      }
      if (!namespaces.contains("http://schemas.xmlsoap.org/wsdl/")) {
          definition.addNamespace("wsdl", "http://schemas.xmlsoap.org/wsdl/");
      }
  }
 
Example 4
Source File: SOAPBindingUtil.java    From cxf with Apache License 2.0 5 votes vote down vote up
public static void addSOAPNamespace(Definition definition, boolean isSOAP12) {
    Map<?, ?> namespaces = definition.getNamespaces();
    if (isSOAP12
        && !namespaces.values().contains(WSDLConstants.NS_SOAP12)) {
        definition.addNamespace("soap12", WSDLConstants.NS_SOAP12);
    } else if (!namespaces.values().contains(WSDLConstants.NS_SOAP11)) {
        definition.addNamespace("soap", WSDLConstants.NS_SOAP11);
    }
}
 
Example 5
Source File: SOAPBindingUtil.java    From cxf with Apache License 2.0 5 votes vote down vote up
public static void addSOAPNamespace(Definition definition, boolean isSOAP12) {
    Map<?, ?> namespaces = definition.getNamespaces();
    if (isSOAP12
        && !namespaces.values().contains(WSDLConstants.NS_SOAP12)) {
        definition.addNamespace("soap12", WSDLConstants.NS_SOAP12);
    } else if (!namespaces.values().contains(WSDLConstants.NS_SOAP11)) {
        definition.addNamespace("soap", WSDLConstants.NS_SOAP11);
    }
}
 
Example 6
Source File: WsdlTypes.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * Create a new for WsdlTypes instance for the specified WSDL definition.
 *
 * @param wsdlDefinition
 *          The WSDL definition.
 */
@SuppressWarnings( "unchecked" )
protected WsdlTypes( Definition wsdlDefinition ) {

  _types = wsdlDefinition.getTypes();
  _targetNamespace = wsdlDefinition.getTargetNamespace();
  _prefixMappings = wsdlDefinition.getNamespaces();
  _elementFormQualifiedNamespaces = new HashSet<String>( getElementFormQualifiedNamespaces() );
  _namedComplexTypes = new WsdlComplexTypes( this );
}