Author: asoldano
Date: 2013-09-16 09:03:35 -0400 (Mon, 16 Sep 2013)
New Revision: 17922
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1807/JBWS1807TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1807/ProviderImpl.java
Log:
[JBWS-3705] Fixing broken testcase
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1807/JBWS1807TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1807/JBWS1807TestCase.java 2013-09-16
08:48:14 UTC (rev 17921)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1807/JBWS1807TestCase.java 2013-09-16
13:03:35 UTC (rev 17922)
@@ -72,10 +72,10 @@
service.addPort(portName, HTTPBinding.HTTP_BINDING, TARGET_ENDPOINT_ADDRESS);
Dispatch<Source> dispatch = service.createDispatch(portName, Source.class,
Mode.PAYLOAD);
- Source resPayload = dispatch.invoke(new
DOMSource(DOMUtils.parse("<input>hello</input>")));
+ Source resPayload = dispatch.invoke(new
DOMSource(DOMUtils.parse("<ns2:input
xmlns:ns2='http://ws.com/'><arg0>hello</arg0></...;
Element docElement = DOMUtils.sourceToElement(resPayload);
- Element response = ((Element)DOMUtils.getChildElements(docElement,
"input").next());
+ Element response = ((Element)DOMUtils.getChildElements(docElement,
"return").next());
assertEquals("hello", response.getTextContent());
}
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1807/ProviderImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1807/ProviderImpl.java 2013-09-16
08:48:14 UTC (rev 17921)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1807/ProviderImpl.java 2013-09-16
13:03:35 UTC (rev 17922)
@@ -39,6 +39,7 @@
import org.jboss.logging.Logger;
import org.jboss.test.helper.DOMWriter;
import org.jboss.ws.api.util.DOMUtils;
+import org.w3c.dom.Element;
@WebServiceProvider(wsdlLocation = "WEB-INF/wsdl/provider.wsdl", portName =
"ProviderPort", serviceName = "ProviderService", targetNamespace =
"http://ws.com/")
@ServiceMode(value = Service.Mode.PAYLOAD)
@@ -52,10 +53,12 @@
{
try
{
- String input = DOMWriter.printNode(DOMUtils.sourceToElement(source,
getDocumentBuilder()), false);
+ Element elem = DOMUtils.sourceToElement(source, getDocumentBuilder());
+ String value = DOMUtils.getChildElements(elem, "arg0",
true).next().getTextContent();
+ String input = DOMWriter.printNode(elem, false);
log.info("invoke: " + input);
- String reply = "<reply>" + input + "</reply>";
+ String reply = "<myns:reply
xmlns:myns='http://ws.com/'><return>" + value +
"</return></myns:reply>";
return new StreamSource(new ByteArrayInputStream(reply.getBytes()));
}
catch (IOException ex)