Allows to choose the version of sensinact to be connected to
diff --git a/services/org.eclipse.sensinact.studio.preferences/.classpath b/services/org.eclipse.sensinact.studio.preferences/.classpath
index 16d067f..01836c4 100644
--- a/services/org.eclipse.sensinact.studio.preferences/.classpath
+++ b/services/org.eclipse.sensinact.studio.preferences/.classpath
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/services/org.eclipse.sensinact.studio.preferences/src/org/eclipse/sensinact/studio/preferences/ConfigurationManager.java b/services/org.eclipse.sensinact.studio.preferences/src/org/eclipse/sensinact/studio/preferences/ConfigurationManager.java
index 1c6086b..5ce796f 100644
--- a/services/org.eclipse.sensinact.studio.preferences/src/org/eclipse/sensinact/studio/preferences/ConfigurationManager.java
+++ b/services/org.eclipse.sensinact.studio.preferences/src/org/eclipse/sensinact/studio/preferences/ConfigurationManager.java
@@ -30,6 +30,7 @@
 	private static String STUDIO_NODE = "studio";
 	private static String ADDRESS_KEY = "address";
 	private static String PORT_KEY = "port";
+	private static String VERSION_KEY = "version";	
 	private static String TIMEOUT_KEY = "timeout";
 	private static String USERNAME_KEY = "username";
 	private static String PASSWORD_KEY = "password";
@@ -68,12 +69,13 @@
 				Preferences gwPref = gatewaysNode.node(name);
 				String address = gwPref.get(ADDRESS_KEY, "");
 				int port = gwPref.getInt(PORT_KEY, 0);
+				int version = gwPref.getInt(VERSION_KEY, 2);
 				int timeout = gwPref.getInt(TIMEOUT_KEY, 0);
 				String username = gwPref.get(USERNAME_KEY, "");
 				String password = gwPref.get(PASSWORD_KEY, "");
 				
 				try {
-					GatewayHttpConfig gateway = new GatewayHttpConfig(name, address, port, timeout, username, password);
+					GatewayHttpConfig gateway = new GatewayHttpConfig(name, address, port, timeout, username, password, version);
 					gateways.add(gateway);
 				} catch (IllegalArgumentException e) {
 					// ignore
@@ -121,6 +123,7 @@
 		curGatewayNode.put(ADDRESS_KEY, gateway.getURL().getHost());
 		curGatewayNode.putInt(PORT_KEY, gateway.getURL().getPort());
 		curGatewayNode.putInt(TIMEOUT_KEY, gateway.getTimeout());
+		curGatewayNode.putInt(VERSION_KEY, gateway.getVersion());
 		curGatewayNode.put(USERNAME_KEY, gateway.getUsername());
 		curGatewayNode.put(PASSWORD_KEY, gateway.getPassword());	
 		
diff --git a/services/org.eclipse.sensinact.studio.preferences/src/org/eclipse/sensinact/studio/preferences/GatewayHttpConfig.java b/services/org.eclipse.sensinact.studio.preferences/src/org/eclipse/sensinact/studio/preferences/GatewayHttpConfig.java
index 1d02cbd..f01370c 100644
--- a/services/org.eclipse.sensinact.studio.preferences/src/org/eclipse/sensinact/studio/preferences/GatewayHttpConfig.java
+++ b/services/org.eclipse.sensinact.studio.preferences/src/org/eclipse/sensinact/studio/preferences/GatewayHttpConfig.java
@@ -21,13 +21,14 @@
 public class GatewayHttpConfig {
 
 	private final String name;
+	private final int version;
 	private final URL gatewayURL;
 	private final int timeout;
 	private final String username;
 	private final String password;
 	
-	public GatewayHttpConfig(String name, String address, int port, int timeout, String username, String password) {
-		this(name, generateGatewayURL(address, port), timeout, username, password);		
+	public GatewayHttpConfig(String name, String address, int port, int timeout, String username, String password, int version) {
+		this(name, generateGatewayURL(address, port), timeout, username, password, version);		
 	}
 	
 	private static URL generateGatewayURL(String address, int port) {
@@ -47,11 +48,11 @@
 		}
 	}
 
-	public GatewayHttpConfig(String name, URL gatewayURL, int timeout, String username, String password) {	
+	public GatewayHttpConfig(String name, URL gatewayURL, int timeout, String username, String password, int version) {	
+		this.version = version;
 		if (name == null || name.isEmpty())
 			throw new IllegalArgumentException("name can't be null or empty");
 		this.name = name;
-		
 		if (gatewayURL == null)
 			throw new IllegalArgumentException("gatewayURL can't be null");
 		this.gatewayURL = gatewayURL ;
@@ -80,10 +81,21 @@
 		URL url = getURL();
 		String host = url.getHost();
 		int port = url.getPort();
-		String wsuri = String.format("ws://%s:%d/ws", host, port);
+		String wsuri = null;
+		if(version == 2)
+			wsuri = String.format("ws://%s:%d/ws/sensinact", host, port);
+		else 
+			wsuri = String.format("ws://%s:%d/ws", host, port);
+		System.out.println("------------------------------------");
+		System.out.println(wsuri);
+		System.out.println("------------------------------------");
 		return new URI(wsuri);
 	}
-		
+
+	public int getVersion() {
+		return version;
+	}
+	
 	public int getTimeout() {
 		return timeout;
 	}