cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1081504 - in /cxf/trunk: 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
Date Mon, 14 Mar 2011 18:27:29 GMT
Author: dkulp
Date: Mon Mar 14 18:27:29 2011
New Revision: 1081504

URL: http://svn.apache.org/viewvc?rev=1081504&view=rev
Log:
[CXF-3401] Make the ns map a contextual property

Modified:
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java
    cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java?rev=1081504&r1=1081503&r2=1081504&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java
Mon Mar 14 18:27:29 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/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java?rev=1081504&r1=1081503&r2=1081504&view=diff
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
(original)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
Mon Mar 14 18:27:29 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");



Mime
View raw message