code: public void associateTarget( AbstractApplication app, String instancePathOrComponentName, String targetId, boolean bind )
  	throws TargetWsException {
  
  		if( bind )
  			this.logger.finer( "Associating " + app + " :: " + instancePathOrComponentName + " with " + targetId );
  		else
  			this.logger.finer( "Dissociating " + app + " :: " + instancePathOrComponentName + " from " + targetId );
  
  		WebResource path = this.resource.path( UrlConstants.TARGETS )
  				.path( targetId ).path( "associations" )
  				.queryParam( "bind", Boolean.toString( bind ))
  				.queryParam( "name", app.getName());
  
  		if( instancePathOrComponentName != null )
  			path = path.queryParam( "elt", instancePathOrComponentName );
  
  		if( app instanceof ApplicationTemplate )
  			path = path.queryParam( "qualifier", ((ApplicationTemplate) app).getVersion());
  
  		ClientResponse response = this.wsClient.createBuilder( path )
  						.accept( MediaType.APPLICATION_JSON )
  						.post( ClientResponse.class );
  
  		handleResponse( response );
  	}
docs: Associates or dissociates an application and a target.
  @param app an application or application template
  @param targetId a target ID
  @param instancePathOrComponentName an instance path or a component name (can be null)
  @param bind true to create a binding, false to delete one
  @throws TargetWsException