You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2011/03/14 19:30:09 UTC
svn commit: r1081508 - in /cxf/branches/2.3.x-fixes: ./
rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java
systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
Author: dkulp
Date: Mon Mar 14 18:30:08 2011
New Revision: 1081508
URL: http://svn.apache.org/viewvc?rev=1081508&view=rev
Log:
Merged revisions 1081504 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1081504 | dkulp | 2011-03-14 14:27:29 -0400 (Mon, 14 Mar 2011) | 1 line
[CXF-3401] Make the ns map a contextual property
........
Modified:
cxf/branches/2.3.x-fixes/ (props changed)
cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java
cxf/branches/2.3.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java?rev=1081508&r1=1081507&r2=1081508&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java (original)
+++ cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java Mon Mar 14 18:30:08 2011
@@ -81,7 +81,7 @@ public class SoapMessage extends Message
}
public Map<String, String> getEnvelopeNs() {
- return CastUtils.cast((Map<? , ?>)get("soap.env.ns.map"));
+ return CastUtils.cast((Map<? , ?>)getContextualProperty("soap.env.ns.map"));
}
public boolean hasAdditionalEnvNs() {
Modified: cxf/branches/2.3.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java?rev=1081508&r1=1081507&r2=1081508&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java (original)
+++ cxf/branches/2.3.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java Mon Mar 14 18:30:08 2011
@@ -22,6 +22,8 @@ package org.apache.cxf.systest.dispatch;
import java.io.InputStream;
import java.net.SocketTimeoutException;
import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
@@ -41,11 +43,13 @@ import javax.xml.ws.Endpoint;
import javax.xml.ws.Response;
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.SOAPBinding;
import javax.xml.ws.soap.SOAPFaultException;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
import org.w3c.dom.Document;
+import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
@@ -89,8 +93,16 @@ public class DispatchClientServerTest ex
String address = "http://localhost:"
+ TestUtil.getPortNumber(DispatchClientServerTest.class)
+ "/SOAPDispatchService/SoapDispatchPort";
- Endpoint.publish(address, implementor);
-
+ Endpoint ep = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, implementor);
+
+ Map<String, Object> properties = new HashMap<String, Object>();
+ Map<String, String> nsMap = new HashMap<String, String>();
+ nsMap.put("gmns", "http://apache.org/hello_world_soap_http/types");
+ properties.put("soap.env.ns.map", nsMap);
+ properties.put("disable.outputstream.optimization", "true");
+
+ ep.setProperties(properties);
+ ep.publish(address);
}
public static void main(String[] args) {
@@ -327,6 +339,12 @@ public class DispatchClientServerTest ex
assertEquals("Response should be : Hello TestSOAPInputMessage", expected, domResMsg.getNode()
.getFirstChild().getTextContent().trim());
+
+ Element el = (Element)domResMsg.getNode().getFirstChild();
+ System.out.println(DOMUtils.getElementQName(el));
+ assertEquals("gmns", el.lookupPrefix("http://apache.org/hello_world_soap_http/types"));
+ assertEquals("http://apache.org/hello_world_soap_http/types",
+ el.lookupNamespaceURI("gmns"));
// Test invoke oneway
InputStream is1 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq1.xml");