diff --git a/teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java b/teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java
index 3254486a3..1b0494a72 100644
--- a/teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java
+++ b/teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java
@@ -123,7 +123,7 @@ public Document parse(URLConnection uc, Element instruction,
*
* @author Simone Gianfranceschi
*/
- private Document parse(Object xml, Element instruction, PrintWriter logger)
+ public Document parse(Object xml, Element instruction, PrintWriter logger)
throws Exception {
Document soapMessage = null;
String returnType = instruction.getAttribute("return");// envelope or
diff --git a/teamengine-core/src/test/java/com/occamlab/te/parsers/SoapParserTest.java b/teamengine-core/src/test/java/com/occamlab/te/parsers/SoapParserTest.java
new file mode 100644
index 000000000..fb99a7a5d
--- /dev/null
+++ b/teamengine-core/src/test/java/com/occamlab/te/parsers/SoapParserTest.java
@@ -0,0 +1,55 @@
+package com.occamlab.te.parsers;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.URL;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+public class SoapParserTest {
+
+ private static DocumentBuilder docBuilder;
+
+ @BeforeClass
+ public static void initFixture() throws ParserConfigurationException {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ docBuilder = dbf.newDocumentBuilder();
+ }
+
+ @Test
+ public void parseWithSchema() throws Exception {
+ Document schemaRefs = parseResourceDocument("/conf/soap-schema.xml");
+ Document doc = parseResourceDocument("/soap-response.xml");
+ StringWriter strWriter = new StringWriter();
+ PrintWriter logger = new PrintWriter(strWriter);
+ SoapParser iut = new SoapParser();
+ Document result = iut.parse(doc, schemaRefs.getDocumentElement(), logger);
+ assertNotNull(result);
+ }
+
+ /**
+ * Parses an XML Document from a classpath resource.
+ *
+ * @param resourcePath
+ * relative to the current class
+ * @return never null
+ */
+ private Document parseResourceDocument(final String resourcePath)
+ throws SAXException, IOException {
+ final URL url = getClass().getResource(resourcePath);
+ final Document doc = docBuilder.parse(url.toString());
+ doc.setDocumentURI(url.toString());
+ return doc;
+ }
+}
diff --git a/teamengine-core/src/test/resources/conf/soap-schema.xml b/teamengine-core/src/test/resources/conf/soap-schema.xml
new file mode 100644
index 000000000..ca2928e3c
--- /dev/null
+++ b/teamengine-core/src/test/resources/conf/soap-schema.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/teamengine-core/src/test/resources/soap-response.xml b/teamengine-core/src/test/resources/soap-response.xml
new file mode 100644
index 000000000..2a93063d3
--- /dev/null
+++ b/teamengine-core/src/test/resources/soap-response.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ test description for this observation
+ http:/www.tsuruoka-nct.ac.jp/test/observation/0
+
+
+
+ 2012-11-19T17:45:15.000Z
+
+
+
+
+
+
+ 0.28
+
+
+
+
+
\ No newline at end of file