Index: /extensions/jiwigo-ws-api/.classpath
===================================================================
--- /extensions/jiwigo-ws-api/.classpath	(revision 9901)
+++ /extensions/jiwigo-ws-api/.classpath	(revision 9902)
@@ -8,9 +8,9 @@
   <classpathentry kind="var" path="M2_REPO/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/>
   <classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.8.3/commons-beanutils-1.8.3.jar"/>
-  <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.2/commons-codec-1.2.jar"/>
-  <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4.jar"/>
   <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5.jar"/>
   <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/jdom/jdom/1.1/jdom-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.1/httpclient-4.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.jar"/>
   <classpathentry kind="var" path="M2_REPO/junit/junit/4.8.1/junit-4.8.1.jar"/>
   <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar"/>
@@ -18,4 +18,4 @@
   <classpathentry kind="var" path="M2_REPO/com/drew/metadata-extractor/2.3.1/metadata-extractor-2.3.1.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/apache/sanselan/sanselan/0.97-incubator/sanselan-0.97-incubator.jar"/>
-  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/java-6-openjdk"/>
 </classpath>
Index: /extensions/jiwigo-ws-api/.project
===================================================================
--- /extensions/jiwigo-ws-api/.project	(revision 9901)
+++ /extensions/jiwigo-ws-api/.project	(revision 9902)
@@ -1,17 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-  <name>jiwigo-ws-api</name>
-  <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
-  <projects/>
-  <buildSpec>
-    <buildCommand>
-      <name>org.eclipse.jdt.core.javabuilder</name>
-    </buildCommand>
-    <buildCommand>
-      <name>org.maven.ide.eclipse.maven2Builder</name>
-    </buildCommand>
-  </buildSpec>
-  <natures>
-    <nature>org.maven.ide.eclipse.maven2Nature</nature>
-    <nature>org.eclipse.jdt.core.javanature</nature>
-  </natures>
+	<name>jiwigo-ws-api</name>
+	<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
 </projectDescription>
Index: /extensions/jiwigo-ws-api/pom.xml
===================================================================
--- /extensions/jiwigo-ws-api/pom.xml	(revision 9901)
+++ /extensions/jiwigo-ws-api/pom.xml	(revision 9902)
@@ -3,5 +3,5 @@
   <groupId>fr.mael.jiwigo</groupId>
   <artifactId>jiwigo-ws-api</artifactId>
-  <version>0.13.1.2</version>
+  <version>0.2b</version>
 
 
@@ -11,9 +11,4 @@
 
 	<dependency>
-	    <groupId>org.jdom</groupId>
-	    <artifactId>jdom</artifactId>
-	    <version>1.1</version>
-	</dependency>
-	<dependency>
 	    <groupId>commons-lang</groupId>
 	    <artifactId>commons-lang</artifactId>
@@ -21,7 +16,7 @@
 	</dependency>
 	<dependency>
-	    <groupId>commons-httpclient</groupId>
-	    <artifactId>commons-httpclient</artifactId>
-	    <version>3.1</version>
+	    <groupId>org.apache.httpcomponents</groupId>
+	    <artifactId>httpclient</artifactId>
+	    <version>4.1</version>
 	</dependency>
 	<dependency>
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CategoryDao.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CategoryDao.java	(revision 9901)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CategoryDao.java	(revision 9902)
@@ -5,6 +5,8 @@
 import java.util.List;
 
-import org.jdom.Document;
-import org.jdom.Element;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 import fr.mael.jiwigo.om.Category;
@@ -72,24 +74,28 @@
 	Document doc = sessionManager.executeReturnDocument(MethodsEnum.LISTER_CATEGORIES.getLabel(), "recursive",
 		String.valueOf(recursive));
-	Element element = doc.getRootElement().getChild("categories");
-	List<Element> listElement = (List<Element>) element.getChildren("category");
+	Element element = (Element) doc.getDocumentElement().getElementsByTagName("categories").item(0);
+	NodeList nodeList = element.getElementsByTagName("category");
 	ArrayList<Category> categories = new ArrayList<Category>();
-	for (Element cat : listElement) {
-	    Category myCat = new Category();
-	    myCat.setIdentifier(Integer.valueOf(cat.getAttributeValue(CategoryEnum.ID.getLabel())));
-	    myCat.setUrlCategory(cat.getAttributeValue(CategoryEnum.URL.getLabel()));
-	    myCat.setNbImages(Integer.valueOf(cat.getAttributeValue(CategoryEnum.NB_IMAGES.getLabel())));
-	    myCat.setNbTotalImages(Integer.valueOf(cat.getAttributeValue(CategoryEnum.NB_TOTAL_IMAGES.getLabel())));
-	    myCat.setName(cat.getChildText(CategoryEnum.NAME.getLabel()));
-	    String catMeres = cat.getChildText(CategoryEnum.CAT_MERES.getLabel());
-	    ArrayList<Integer> idCategoriesMeres = new ArrayList<Integer>();
-	    myCat.setIdParentCategoriesString(catMeres);
-	    for (String catA : catMeres.split(",")) {
-		if (!catA.equals("")) {
-		    idCategoriesMeres.add(Integer.valueOf(catA));
+	for (int i = 0; i < nodeList.getLength(); i++) {
+	    Node catNode = nodeList.item(i);
+	    if (catNode.getNodeType() == Node.ELEMENT_NODE) {
+		Element cat = (Element) catNode;
+		Category myCat = new Category();
+		myCat.setIdentifier(Integer.valueOf(cat.getAttribute(CategoryEnum.ID.getLabel())));
+		myCat.setUrlCategory(cat.getAttribute(CategoryEnum.URL.getLabel()));
+		myCat.setNbImages(Integer.valueOf(cat.getAttribute(CategoryEnum.NB_IMAGES.getLabel())));
+		myCat.setNbTotalImages(Integer.valueOf(cat.getAttribute(CategoryEnum.NB_TOTAL_IMAGES.getLabel())));
+		myCat.setName(Tools.getStringValueDom(cat, CategoryEnum.NAME.getLabel()));
+		String catMeres = Tools.getStringValueDom(cat, CategoryEnum.CAT_MERES.getLabel());
+		ArrayList<Integer> idCategoriesMeres = new ArrayList<Integer>();
+		myCat.setIdParentCategoriesString(catMeres);
+		for (String catA : catMeres.split(",")) {
+		    if (!catA.equals("")) {
+			idCategoriesMeres.add(Integer.valueOf(catA));
+		    }
 		}
+		myCat.setIdParentCategories(idCategoriesMeres);
+		categories.add(myCat);
 	    }
-	    myCat.setIdParentCategories(idCategoriesMeres);
-	    categories.add(myCat);
 	}
 	return categories;
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CommentDao.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CommentDao.java	(revision 9901)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CommentDao.java	(revision 9902)
@@ -5,6 +5,8 @@
 import java.util.List;
 
-import org.jdom.Document;
-import org.jdom.Element;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 import fr.mael.jiwigo.om.Comment;
@@ -72,14 +74,19 @@
 	Document doc = (sessionManager.executeReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String
 		.valueOf(idImage), "comments_per_page", "100"));
-	Element element = doc.getRootElement().getChild("image").getChild("comments");
-	List<Element> listElement = (List<Element>) element.getChildren("comment");
+	Element elementImage = (Element) doc.getDocumentElement().getElementsByTagName("image").item(0);
+	Element elementComments = (Element) elementImage.getElementsByTagName("comments").item(0);
+	NodeList listComments = elementComments.getElementsByTagName("comment");
 	ArrayList<Comment> comments = new ArrayList<Comment>();
-	for (Element com : listElement) {
-	    Comment myCom = new Comment();
-	    myCom.setIdentifier(Integer.valueOf(com.getAttributeValue("id")));
-	    myCom.setDate(com.getAttributeValue("date"));
-	    myCom.setAuthor(com.getChildText("author"));
-	    myCom.setContent(com.getChildText("content"));
-	    comments.add(myCom);
+	for (int i = 0; i < listComments.getLength(); i++) {
+	    Node nodeCom = listComments.item(i);
+	    if (nodeCom.getNodeType() == Node.ELEMENT_NODE) {
+		Element com = (Element) nodeCom;
+		Comment myCom = new Comment();
+		myCom.setIdentifier(Integer.valueOf(com.getAttribute("id")));
+		myCom.setDate(com.getAttribute("date"));
+		myCom.setAuthor(Tools.getStringValueDom(com, "author"));
+		myCom.setContent(Tools.getStringValueDom(com, "content"));
+		comments.add(myCom);
+	    }
 	}
 	return comments;
@@ -96,6 +103,8 @@
 	Document doc = (sessionManager.executeReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String
 		.valueOf(idImage)));
-	String key = doc.getRootElement().getChild("image").getChild("comment_post").getAttributeValue("key");
-	return key;
+	//	String key = doc.getRootElement().getChild("image").getChild("comment_post").getAttributeValue("key");
+	Element elementImage = (Element) doc.getDocumentElement().getElementsByTagName("image").item(0);
+	Element elementCommentPost = (Element) elementImage.getElementsByTagName("comment_post").item(0);
+	return elementCommentPost.getAttribute("key");
     }
 
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/ImageDao.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/ImageDao.java	(revision 9901)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/ImageDao.java	(revision 9902)
@@ -8,6 +8,8 @@
 import java.util.List;
 
-import org.jdom.Document;
-import org.jdom.Element;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 import sun.misc.BASE64Encoder;
@@ -103,5 +105,4 @@
 	if (refresh || cache.get(categoryId) == null) {
 	    Document doc = null;
-
 	    if (categoryId != null) {
 		doc = sessionManager.executeReturnDocument(MethodsEnum.LISTER_IMAGES.getLabel(), "cat_id", String
@@ -110,5 +111,5 @@
 		doc = sessionManager.executeReturnDocument(MethodsEnum.LISTER_IMAGES.getLabel());
 	    }
-	    Element element = doc.getRootElement().getChild("images");
+	    Element element = (Element) doc.getDocumentElement().getElementsByTagName("images").item(0);
 	    List<Image> images = getImagesFromElement(element);
 	    cache.remove(categoryId);
@@ -222,22 +223,28 @@
      */
     private List<Image> getImagesFromElement(Element element) {
-	List<Element> listElement = (List<Element>) element.getChildren("image");
+	//	List<Element> listElement = (List<Element>) element.getChildren("image");
+	NodeList listImages = element.getElementsByTagName("image");
 	ArrayList<Image> images = new ArrayList<Image>();
-	for (Element im : listElement) {
-	    Image myImage = new Image();
-	    myImage.setThumbnailUrl(im.getAttributeValue("tn_url"));
-	    myImage.setUrl(im.getAttributeValue("element_url"));
-	    myImage.setWidth(Integer.valueOf(im.getAttributeValue("width")));
-	    myImage.setHeight(Integer.valueOf(im.getAttributeValue("height")));
-	    myImage.setFile(im.getAttributeValue("file"));
-	    myImage.setSeen(Integer.valueOf(im.getAttributeValue("hit")));
-	    myImage.setIdentifier(Integer.valueOf(im.getAttributeValue("id")));
-	    myImage.setName(im.getChildText("name"));
-	    myImage.setIdCategory(Integer.valueOf(im.getChild("categories").getChild("category")
-		    .getAttributeValue("id")));
-	    if (myImage.getName() == null) {
-		myImage.setName(myImage.getFile());
-	    }
-	    images.add(myImage);
+	for (int i = 0; i < listImages.getLength(); i++) {
+	    Node nodeImage = listImages.item(i);
+	    if (nodeImage.getNodeType() == Node.ELEMENT_NODE) {
+		Element im = (Element) nodeImage;
+		Image myImage = new Image();
+		myImage.setThumbnailUrl(im.getAttribute("tn_url"));
+		myImage.setUrl(im.getAttribute("element_url"));
+		myImage.setWidth(Integer.valueOf(im.getAttribute("width")));
+		myImage.setHeight(Integer.valueOf(im.getAttribute("height")));
+		myImage.setFile(im.getAttribute("file"));
+		myImage.setSeen(Integer.valueOf(im.getAttribute("hit")));
+		myImage.setIdentifier(Integer.valueOf(im.getAttribute("id")));
+		myImage.setName(Tools.getStringValueDom(im, "name"));
+		Element elementCategories = (Element) im.getElementsByTagName("categories").item(0);
+		Element elementCategory = (Element) elementCategories.getElementsByTagName("category").item(0);
+		myImage.setIdCategory(Integer.valueOf(elementCategory.getAttribute("id")));
+		if (myImage.getName() == null) {
+		    myImage.setName(myImage.getFile());
+		}
+		images.add(myImage);
+	    }
 	}
 	return images;
@@ -254,5 +261,5 @@
 	Document doc = sessionManager.executeReturnDocument(MethodsEnum.SEARCH.getLabel(), "query", searchString);
 	LOG.debug(doc);
-	Element element = doc.getRootElement().getChild("images");
+	Element element = (Element) doc.getDocumentElement().getElementsByTagName("images").item(0);
 	return getImagesFromElement(element);
 
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/TagDao.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/TagDao.java	(revision 9901)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/TagDao.java	(revision 9902)
@@ -5,6 +5,8 @@
 import java.util.List;
 
-import org.jdom.Document;
-import org.jdom.Element;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 import fr.mael.jiwigo.om.Image;
@@ -71,5 +73,6 @@
 	Document doc = sessionManager.executeReturnDocument(MethodsEnum.TAGS_ADMIN_LIST.getLabel());
 	//	System.out.println(Outil.documentToString(doc));
-	return getTagsFromDocument(doc.getRootElement().getChild("tags"));
+
+	return getTagsFromDocument((Element) doc.getDocumentElement().getElementsByTagName("tags"));
 
     }
@@ -81,12 +84,17 @@
      */
     private List<Tag> getTagsFromDocument(Element element) {
+	NodeList listTags = element.getElementsByTagName("tag");
 
-	List<Element> listElement = (List<Element>) element.getChildren("tag");
+	//	List<Element> listElement = (List<Element>) element.getChildren("tag");
 	ArrayList<Tag> tags = new ArrayList<Tag>();
-	for (Element tagElement : listElement) {
-	    Tag tag = new Tag();
-	    tag.setIdentifier(Integer.valueOf(tagElement.getAttributeValue(TagEnum.ID.getLabel())));
-	    tag.setName(tagElement.getAttributeValue(TagEnum.NAME.getLabel()));
-	    tags.add(tag);
+	for (int i = 0; i < listTags.getLength(); i++) {
+	    Node nodeTag = listTags.item(0);
+	    if (nodeTag.getNodeType() == Node.ELEMENT_NODE) {
+		Element tagElement = (Element) nodeTag;
+		Tag tag = new Tag();
+		tag.setIdentifier(Integer.valueOf(tagElement.getAttribute(TagEnum.ID.getLabel())));
+		tag.setName(tagElement.getAttribute(TagEnum.NAME.getLabel()));
+		tags.add(tag);
+	    }
 	}
 	return tags;
@@ -122,5 +130,7 @@
 	Document doc = sessionManager.executeReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String
 		.valueOf(image.getIdentifier()));
-	return getTagsFromDocument(doc.getRootElement().getChild("image").getChild("tags"));
+	Element elementImage = (Element) doc.getDocumentElement().getElementsByTagName("image").item(0);
+	Element elementTag = (Element) elementImage.getElementsByTagName("tags").item(0);
+	return getTagsFromDocument(elementTag);
     }
 
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/om/Category.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/om/Category.java	(revision 9901)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/om/Category.java	(revision 9902)
@@ -3,5 +3,5 @@
 import java.util.ArrayList;
 
-import org.jdom.Element;
+import org.w3c.dom.Element;
 
 /*
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java	(revision 9901)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java	(revision 9902)
@@ -4,15 +4,20 @@
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
-
-import org.apache.commons.httpclient.Credentials;
-import org.apache.commons.httpclient.HostConfiguration;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
-import org.apache.commons.httpclient.UsernamePasswordCredentials;
-import org.apache.commons.httpclient.auth.AuthScope;
-import org.apache.commons.httpclient.methods.PostMethod;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.commons.lang.StringUtils;
-import org.jdom.Document;
-import org.jdom.JDOMException;
+import org.apache.http.HttpHost;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.conn.params.ConnRoutePNames;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
+import org.apache.http.message.BasicNameValuePair;
+import org.w3c.dom.Document;
 
 import fr.mael.jiwigo.transverse.enumeration.MethodsEnum;
@@ -58,5 +63,5 @@
      * the http client
      */
-    private HttpClient client;
+    private DefaultHttpClient client;
 
     /**
@@ -100,6 +105,8 @@
 	this.password = password;
 	this.url = url + "/ws.php";
-	MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
-	client = new HttpClient(connectionManager);
+	//	MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
+	//	client = new HttpClient(connectionManager);
+	ThreadSafeClientConnManager connectionManager = new ThreadSafeClientConnManager();
+	client = new DefaultHttpClient(connectionManager);
 	//Using of a Linux user agent. cause... it's better 8)
 	client.getParams().setParameter("http.useragent",
@@ -119,10 +126,15 @@
 	//configures the proxy
 	if (usesProxy) {
-	    HostConfiguration config = client.getHostConfiguration();
-	    config.setProxy(urlProxy, portProxy);
+	    //	    HostConfiguration config = client.getHostConfiguration();
+	    //	    config.setProxy(urlProxy, portProxy);
 	    if (!StringUtils.isEmpty(loginProxy) && !StringUtils.isEmpty(passProxy)) {
-		Credentials credentials = new UsernamePasswordCredentials(loginProxy, passProxy);
-		AuthScope authScope = new AuthScope(urlProxy, portProxy);
-		client.getState().setProxyCredentials(authScope, credentials);
+		//		Credentials credentials = new UsernamePasswordCredentials(loginProxy, passProxy);
+		//		AuthScope authScope = new AuthScope(urlProxy, portProxy);
+		//		client.getState().setProxyCredentials(authScope, credentials);
+		HttpHost proxy = new HttpHost(urlProxy, portProxy);
+		client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
+		client.getCredentialsProvider().setCredentials(new AuthScope(urlProxy, portProxy),
+			new UsernamePasswordCredentials(loginProxy, passProxy));
+
 	    }
 	}
@@ -162,25 +174,36 @@
 	    }
 	}
-	PostMethod method = new PostMethod(url);
-	method.addParameter("method", methode);
+	HttpPost method = new HttpPost(url);
+	List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
+	nameValuePairs.add(new BasicNameValuePair("method", methode));
 	for (int i = 0; i < parametres.length; i += 2) {
-	    //	    System.out.println(parametres[i] + " -> " + parametres[i + 1]);
-	    method.addParameter(parametres[i], parametres[i + 1]);
-
-	}
+	    nameValuePairs.add(new BasicNameValuePair(parametres[i], parametres[i + 1]));
+	}
+	method.setEntity(new UrlEncodedFormEntity(nameValuePairs));
 	//begin bug:0001833
-	method.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
+	method.setHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
 	//end
 	try {
-	    int test = client.executeMethod(method);
-	    if (test == 407) {
-		throw new ProxyAuthenticationException("Proxy configuration exception. Check username and password");
-	    }
-	    InputStream streamResponse = method.getResponseBodyAsStream();
-	    //	    System.out.println(Outil.readInputStreamAsString(streamResponse));
-	    //	    String toReturn = method.getResponseBodyAsString();
-	    String toReturn = Tools.readInputStreamAsString(streamResponse);
-	    LOG.debug(toReturn);
-	    return toReturn;
+	    HttpResponse response = client.execute(method);
+	    if (response.getStatusLine().getStatusCode() == 407) {
+		throw new ProxyAuthenticationException("Error while trying to auth on the proxy");
+	    }
+	    InputStream inputStream = response.getEntity().getContent();
+	    StringBuffer buffer = new StringBuffer();
+	    byte[] data = new byte[512];
+	    int len = 0;
+	    try {
+		while (-1 != (len = inputStream.read(data))) {
+		    buffer.append(new String(data, 0, len));
+		}
+	    } catch (IOException e) {
+		e.printStackTrace();
+	    }
+	    try {
+		inputStream.close();
+	    } catch (IOException e) {
+		e.printStackTrace();
+	    }
+	    return buffer.toString();
 	} catch (IOException e) {
 
@@ -203,5 +226,5 @@
 	    String returnedString = executeReturnString(methode, parametres);
 	    return Tools.stringToDocument(returnedString);
-	} catch (JDOMException e) {
+	} catch (Exception e) {
 	    // TODO Auto-generated catch block
 	    LOG.error(Tools.getStackTrace(e));
@@ -220,10 +243,7 @@
 	try {
 	    return Tools.stringToDocument(executeReturnString(methode));
-	} catch (JDOMException e) {
+	} catch (Exception e) {
 	    // TODO Auto-generated catch block
 	    LOG.error(Tools.getStackTrace(e));
-	} catch (IOException e) {
-	    // TODO Auto-generated catch block
-	    LOG.error(Tools.getStackTrace(e));
 	}
 	return null;
Index: /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/Tools.java
===================================================================
--- /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/Tools.java	(revision 9901)
+++ /extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/Tools.java	(revision 9902)
@@ -20,4 +20,16 @@
 import java.util.ArrayList;
 
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
 import org.apache.sanselan.Sanselan;
 import org.apache.sanselan.common.IImageMetadata;
@@ -28,8 +40,9 @@
 import org.apache.sanselan.formats.jpeg.iptc.PhotoshopApp13Data;
 import org.apache.sanselan.formats.tiff.write.TiffOutputSet;
-import org.jdom.Document;
-import org.jdom.JDOMException;
-import org.jdom.input.SAXBuilder;
-import org.jdom.output.XMLOutputter;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
 
 import fr.mael.jiwigo.transverse.exception.FileAlreadyExistsException;
@@ -82,9 +95,9 @@
      * @throws IOException
      */
-    public static Document stringToDocument(String string) throws JDOMException, IOException {
-	SAXBuilder sb = new SAXBuilder();
-	Document doc = sb.build(new StringReader(string));
-	return doc;
-
+    public static Document stringToDocument(String xmlSource) throws SAXException, ParserConfigurationException,
+	    IOException {
+	DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+	DocumentBuilder builder = factory.newDocumentBuilder();
+	return builder.parse(new InputSource(new StringReader(xmlSource)));
     }
 
@@ -93,8 +106,12 @@
      * @param input the inputStream
      * @return the document
+     * @throws IOException
+     * @throws ParserConfigurationException
+     * @throws SAXException
      * @throws JDOMException
      * @throws IOException
      */
-    public static Document readInputStreamAsDocument(InputStream input) throws JDOMException, IOException {
+    public static Document readInputStreamAsDocument(InputStream input) throws SAXException,
+	    ParserConfigurationException, IOException {
 	return stringToDocument(readInputStreamAsString(input));
     }
@@ -105,7 +122,19 @@
      * @return the string
      */
-    public static String documentToString(Document doc) {
-	return new XMLOutputter().outputString(doc);
-
+    public static String documentToString(Node node) {
+	try {
+	    Source source = new DOMSource(node);
+	    StringWriter stringWriter = new StringWriter();
+	    Result result = new StreamResult(stringWriter);
+	    TransformerFactory factory = TransformerFactory.newInstance();
+	    Transformer transformer = factory.newTransformer();
+	    transformer.transform(source, result);
+	    return stringWriter.getBuffer().toString();
+	} catch (TransformerConfigurationException e) {
+	    e.printStackTrace();
+	} catch (TransformerException e) {
+	    e.printStackTrace();
+	}
+	return null;
     }
 
@@ -193,10 +222,11 @@
      */
     public static boolean checkOk(Document doc) throws FileAlreadyExistsException {
-	if (doc.getRootElement().getAttributeValue("stat").equals("ok")) {
+	if (doc.getDocumentElement().getAttribute("stat").equals("ok")) {
 	    return true;
 	} else {
-	    LOG.error("Resultat : " + doc.getRootElement().getAttributeValue("stat") + "\nDocument retourné : \n"
+	    LOG.error("Resultat : " + doc.getDocumentElement().getAttribute("stat") + "\nDocument retourné : \n"
 		    + Tools.documentToString(doc));
-	    if (doc.getRootElement().getChild("err").getAttributeValue("msg").equals("file already exists")) {
+	    if (((Element) doc.getDocumentElement().getElementsByTagName("err").item(0)).getAttribute("msg").equals(
+		    "file already exists")) {
 		throw new FileAlreadyExistsException("The file already exists on the server");
 	    }
@@ -296,3 +326,8 @@
 
     }
+
+    public static String getStringValueDom(Element element, String tagName) {
+	Element el = (Element) element.getElementsByTagName(tagName).item(0);
+	return el.getFirstChild().getNodeValue();
+    }
 }
