Index: src/test/java/org/ow2/petals/binding/rest/exchange/outgoing/RestProvideServiceTest.java
===================================================================
--- workspace/petals-trunk/components-sls/components/petals-bc-rest-json/petals-bc-rest/src/test/java/org/ow2/petals/binding/rest/exchange/outgoing/RestProvideServiceTest.java	(revision 43416)
+++ workspace/petals-trunk/components-sls/components/petals-bc-rest-json/petals-bc-rest/src/test/java/org/ow2/petals/binding/rest/exchange/outgoing/RestProvideServiceTest.java	(working copy)
@@ -350,73 +350,8 @@
         // --------------------------------------------------------------------------
         // Remote resource exists --> A normal response is returned on a JSON return
         // --------------------------------------------------------------------------
-        {
-            final Consulter requestBean = new Consulter();
-            requestBean.setLibrary(MY_LIBRARY);
-            requestBean.setReference(docReference);
-
-            // Send the valid request
-            final RequestToProviderMessage request = new RequestToProviderMessage(COMPONENT_UNDER_TEST, GED_PROVIDE_SU,
-                    GED_METADATA_VIA_JSON_OPERATION, AbsItfOperation.MEPPatternConstants.IN_OUT.value(), requestBean,
-                    MARSHALLER);
-
-            // We send the request to the service.
-            final ResponseMessage response = COMPONENT.sendAndGetResponse(request);
-
-            // Check the reply
-            assertFalse(response.isFault());
-            final Source fault = response.getFault();
-            assertNull("Unexpected fault", (fault == null ? null : SourceHelper.toString(fault)));
-            assertNotNull("No XML payload in response", response.getPayload());
-            assertNotNull(response.getOutAttachmentNames());
-            assertEquals(0, response.getOutAttachmentNames().size());
-            final Object responseBeanObj = UNMARSHALLER.unmarshal(response.getPayload());
-            assertTrue(responseBeanObj instanceof MetadataResponse);
-            final MetadataResponse responseBean = (MetadataResponse) responseBeanObj;
-            assertNotNull(responseBean.getMetadatas());
-            assertNotNull(responseBean.getMetadatas().getMetadata());
-            assertEquals(5, responseBean.getMetadatas().getMetadata().size());
-            boolean titleFound = false;
-            boolean authorFound = false;
-            boolean httpStatusCodeFound = false;
-            boolean httpStatusReasonFound = false;
-            boolean httpHeaderFound = false;
-            for (final TMetadatas.Metadata metadata : responseBean.getMetadatas().getMetadata()) {
-                if (metadataTitle.equals(metadata.getName())) {
-                    titleFound = true;
-                    assertEquals(metadataTitleValue, metadata.getValue());
-                } else if (metadataAuthor.equals(metadata.getName())) {
-                    authorFound = true;
-                    assertEquals("Petals ESB creators", metadata.getValue());
-                } else if ("httpStatusCode".equals(metadata.getName())) {
-                    httpStatusCodeFound = true;
-                    assertEquals(String.valueOf(HttpStatus.Code.OK.getCode()), metadata.getValue());
-                } else if ("httpStatusReason".equals(metadata.getName())) {
-                    httpStatusReasonFound = true;
-                    assertEquals(HttpStatus.Code.OK.getMessage(), metadata.getValue());
-                } else if ("contentType".equals(metadata.getName())) {
-                    httpHeaderFound = true;
-                    assertEquals("application/json", metadata.getValue());
-                } else {
-                    fail("Unexpected metadata: " + metadata.getName());
-                }
-            }
-            assertTrue(titleFound);
-            assertTrue(authorFound);
-            assertTrue(httpStatusCodeFound);
-            assertTrue(httpStatusReasonFound);
-            assertTrue(httpHeaderFound);
-
-            // Check MONIT traces
-            final List<LogRecord> monitLogs = IN_MEMORY_LOG_HANDLER.getAllRecords(Level.MONIT);
-            assertEquals(4, monitLogs.size());
-            final FlowLogData beginFlowLogData = assertMonitProviderBeginLog(GED_INTERFACE, GED_SERVICE, GED_ENDPOINT,
-                    GED_METADATA_VIA_JSON_OPERATION, monitLogs.get(0));
-            final FlowLogData beginExtFlowLogData = assertMonitProviderExtBeginLog(beginFlowLogData, monitLogs.get(1));
-            assertMonitProviderExtEndLog(beginExtFlowLogData, monitLogs.get(2));
-            assertMonitProviderEndLog(beginFlowLogData, monitLogs.get(3));
-        }
-        IN_MEMORY_LOG_HANDLER.clear();
+        this.getResourceMetadataJson_InOut_OK(docReference, metadataTitle, metadataTitleValue, metadataAuthor,
+                metadataAuthorValue);
 
         // --------------------------------------------------------------------------
         // Remote resource exists --> A normal response is returned on a XML return
@@ -1526,4 +1461,136 @@
         assertArrayEquals(ebaosLogo.toByteArray(), IOUtils.toByteArray(documentDh.getInputStream()));
     }
 
+    /**
+     * <p>
+     * Check the processing of a InOut message exchange to get values of a remote resource for which:
+     * </p>
+     * <ul>
+     * <li>remote resource identifier contains special characters: french characters, space or path separator,</li>
+     * <li>normal response is adapted to the WSDL.</li>
+     * </ul>
+     * <p>
+     * Expected results:
+     * </p>
+     * <ul>
+     * <li>on a JSON return, a normal response is returned when the remote resource exists, values are correctly get,
+     * and XML output is compliant with the WSDL.</li>
+     * </ul>
+     */
+    @Test
+    public void getResourceMetadata_InOut_FrenchCharacters() throws Exception {
+
+        final String metadataTitle = "title";
+        final String metadataTitleValue = "My document title with french characters '&éèàï'";
+        final String metadataAuthor = "author";
+        final String metadataAuthorValue = "Petals ESB creators";
+        
+        final String docReferenceWithFrenchChars = "&éèàï";
+        REST_SERVER.addDocument(MY_LIBRARY, docReferenceWithFrenchChars);
+        REST_SERVER.setMetadata(MY_LIBRARY, docReferenceWithFrenchChars, metadataTitle, metadataTitleValue);
+        REST_SERVER.setMetadata(MY_LIBRARY, docReferenceWithFrenchChars, metadataAuthor, metadataAuthorValue);
+        
+        final String docReferenceWithSpace = "my identifier";
+        REST_SERVER.addDocument(MY_LIBRARY, docReferenceWithSpace);
+        REST_SERVER.setMetadata(MY_LIBRARY, docReferenceWithSpace, metadataTitle, metadataTitleValue);
+        REST_SERVER.setMetadata(MY_LIBRARY, docReferenceWithSpace, metadataAuthor, metadataAuthorValue);
+        
+        final String docReferenceWithPathSeparator = "my/identifier";
+        REST_SERVER.addDocument(MY_LIBRARY, docReferenceWithPathSeparator);
+        REST_SERVER.setMetadata(MY_LIBRARY, docReferenceWithPathSeparator, metadataTitle, metadataTitleValue);
+        REST_SERVER.setMetadata(MY_LIBRARY, docReferenceWithPathSeparator, metadataAuthor, metadataAuthorValue);
+
+        // --------------------------------------------------------------------------
+        // Remote resource with identifier containing path separator exists --> A normal response is returned on a JSON
+        // return
+        // --------------------------------------------------------------------------
+        this.getResourceMetadataJson_InOut_OK(docReferenceWithPathSeparator, metadataTitle, metadataTitleValue,
+                metadataAuthor, metadataAuthorValue);
+
+        // --------------------------------------------------------------------------
+        // Remote resource with identifier containing french characters exists --> A normal response is returned on a
+        // JSON return
+        // --------------------------------------------------------------------------
+        this.getResourceMetadataJson_InOut_OK(docReferenceWithFrenchChars, metadataTitle, metadataTitleValue,
+                metadataAuthor, metadataAuthorValue);
+
+        // --------------------------------------------------------------------------
+        // Remote resource with identifier containing space exists --> A normal response is returned on a JSON return
+        // --------------------------------------------------------------------------
+        this.getResourceMetadataJson_InOut_OK(docReferenceWithSpace, metadataTitle, metadataTitleValue, metadataAuthor,
+                metadataAuthorValue);
+    }
+    
+    private void getResourceMetadataJson_InOut_OK(final String docReference, final String metadataTitle,
+            final String metadataTitleValue, final String metadataAuthor, final String metadataAuthorValue)
+            throws Exception {
+
+        final Consulter requestBean = new Consulter();
+        requestBean.setLibrary(MY_LIBRARY);
+        requestBean.setReference(docReference);
+
+        // Send the valid request
+        final RequestToProviderMessage request = new RequestToProviderMessage(COMPONENT_UNDER_TEST, GED_PROVIDE_SU,
+                GED_METADATA_VIA_JSON_OPERATION, AbsItfOperation.MEPPatternConstants.IN_OUT.value(), requestBean,
+                MARSHALLER);
+
+        // We send the request to the service.
+        final ResponseMessage response = COMPONENT.sendAndGetResponse(request);
+
+        // Check the reply
+        assertFalse(response.isFault());
+        final Source fault = response.getFault();
+        assertNull("Unexpected fault", (fault == null ? null : SourceHelper.toString(fault)));
+        assertNotNull("No XML payload in response", response.getPayload());
+        assertNotNull(response.getOutAttachmentNames());
+        assertEquals(0, response.getOutAttachmentNames().size());
+        final Object responseBeanObj = UNMARSHALLER.unmarshal(response.getPayload());
+        assertTrue(responseBeanObj instanceof MetadataResponse);
+        final MetadataResponse responseBean = (MetadataResponse) responseBeanObj;
+        assertNotNull(responseBean.getMetadatas());
+        assertNotNull(responseBean.getMetadatas().getMetadata());
+        assertEquals(5, responseBean.getMetadatas().getMetadata().size());
+        boolean titleFound = false;
+        boolean authorFound = false;
+        boolean httpStatusCodeFound = false;
+        boolean httpStatusReasonFound = false;
+        boolean httpHeaderFound = false;
+        for (final TMetadatas.Metadata metadata : responseBean.getMetadatas().getMetadata()) {
+            if (metadataTitle.equals(metadata.getName())) {
+                titleFound = true;
+                assertEquals(metadataTitleValue, metadata.getValue());
+            } else if (metadataAuthor.equals(metadata.getName())) {
+                authorFound = true;
+                assertEquals("Petals ESB creators", metadata.getValue());
+            } else if ("httpStatusCode".equals(metadata.getName())) {
+                httpStatusCodeFound = true;
+                assertEquals(String.valueOf(HttpStatus.Code.OK.getCode()), metadata.getValue());
+            } else if ("httpStatusReason".equals(metadata.getName())) {
+                httpStatusReasonFound = true;
+                assertEquals(HttpStatus.Code.OK.getMessage(), metadata.getValue());
+            } else if ("contentType".equals(metadata.getName())) {
+                httpHeaderFound = true;
+                assertEquals("application/json", metadata.getValue());
+            } else {
+                fail("Unexpected metadata: " + metadata.getName());
+            }
+        }
+        assertTrue(titleFound);
+        assertTrue(authorFound);
+        assertTrue(httpStatusCodeFound);
+        assertTrue(httpStatusReasonFound);
+        assertTrue(httpHeaderFound);
+
+        // Check MONIT traces
+        final List<LogRecord> monitLogs = IN_MEMORY_LOG_HANDLER.getAllRecords(Level.MONIT);
+        assertEquals(4, monitLogs.size());
+        final FlowLogData beginFlowLogData = assertMonitProviderBeginLog(GED_INTERFACE, GED_SERVICE, GED_ENDPOINT,
+                GED_METADATA_VIA_JSON_OPERATION, monitLogs.get(0));
+        final FlowLogData beginExtFlowLogData = assertMonitProviderExtBeginLog(beginFlowLogData, monitLogs.get(1));
+        assertMonitProviderExtEndLog(beginExtFlowLogData, monitLogs.get(2));
+        assertMonitProviderEndLog(beginFlowLogData, monitLogs.get(3));
+
+        IN_MEMORY_LOG_HANDLER.clear();
+    }
+
 }
