cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r530089 - in /incubator/cxf/trunk: rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ systests/src...
Date Wed, 18 Apr 2007 16:56:53 GMT
Author: dkulp
Date: Wed Apr 18 09:56:52 2007
New Revision: 530089

URL: http://svn.apache.org/viewvc?view=rev&rev=530089
Log:
Don't clear request properties between invokations. Fix potential NPE in servlet.

Modified:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Messages.properties
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Messages.properties?view=diff&rev=530089&r1=530088&r2=530089
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Messages.properties
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Messages.properties
Wed Apr 18 09:56:52 2007
@@ -25,4 +25,4 @@
 PARSER_EXC=Could not create DOM DocumentBuilder.
 NO_OPERATION=No such operation: {0}
 ATTACHMENT_IO=Attachment IO Exception: {0}
-INVALID_VERSION="{0}" is not a valid SOAP version.
\ No newline at end of file
+INVALID_VERSION="{0}" is not a valid SOAP version.

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java?view=diff&rev=530089&r1=530088&r2=530089
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
Wed Apr 18 09:56:52 2007
@@ -77,8 +77,8 @@
                 
                 SoapVersion soapVersion = SoapVersionFactory.getInstance().getSoapVersion(ns);
                 if (soapVersion == null) {
-                    throw new SoapFault(new Message("INVALID_VERSION", LOG, ns), Soap11.getInstance()
-                        .getSender());
+                    throw new SoapFault(new Message("INVALID_VERSION", BUNDLE, ns),
+                                            Soap11.getInstance().getSender());
                 }
                 message.setVersion(soapVersion);
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java?view=diff&rev=530089&r1=530088&r2=530089
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
Wed Apr 18 09:56:52 2007
@@ -95,10 +95,9 @@
         if (null == params) {
             params = new Object[0];
         }
-        Map<String, Object> reqContext = this.getRequestContext();        
+        Map<String, Object> reqContext = new HashMap<String, Object>(this.getRequestContext());
       
         Map<String, Object> respContext = this.getResponseContext();
-        // Clear the request ThreadLocal variable        
-        clearContext(requestContext);
+        
         // Clear the response context's hold information
         // Not call the clear Context is to avoid the error 
         // that getResponseContext() could be called by Client code first
@@ -147,12 +146,7 @@
             return r;
         }
     }
-    
-    private void clearContext(ThreadLocal<Map<String, Object>> context) {
-        if (null != context.get()) {
-            context.set(null);
-        }
-    }
+
 
     public Map<String, Object> getRequestContext() {
         if (null == requestContext.get()) {

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java?view=diff&rev=530089&r1=530088&r2=530089
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
Wed Apr 18 09:56:52 2007
@@ -158,7 +158,7 @@
             // work around a bug with Jetty which results in the character
             // encoding not being trimmed correctly.
             String enc = request.getCharacterEncoding();
-            if (enc.endsWith("\"")) {
+            if (enc != null && enc.endsWith("\"")) {
                 enc = enc.substring(0, enc.length() - 1);
             }
             

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java?view=diff&rev=530089&r1=530088&r2=530089
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
Wed Apr 18 09:56:52 2007
@@ -700,9 +700,14 @@
                                    realAddress);
         greeter.greetMe("test");
 
+        //should persist
+        greeter.greetMe("test");
+
+        bp.getRequestContext().remove(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+        
         try {
             greeter.greetMe("test");
-            fail("expected address override not to persist beyond a single invocation");
+            fail("Should fail");
         } catch (Fault f) {
             // expected
         }



Mime
View raw message