cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-6045] Changing the way BodyWriters are registered and fixing the test faiures
Date Tue, 14 Oct 2014 10:08:43 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 59716dd9e -> 1e3a0ac4a


[CXF-6045] Changing the way BodyWriters are registered and fixing the test faiures


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1e3a0ac4
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1e3a0ac4
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1e3a0ac4

Branch: refs/heads/2.7.x-fixes
Commit: 1e3a0ac4a1dccb048dceb445fb3e2fba9cfac44f
Parents: 59716dd
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Oct 14 11:02:20 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Oct 14 11:08:23 2014 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java   | 3 ++-
 .../src/main/java/org/apache/cxf/jaxrs/client/WebClient.java     | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/1e3a0ac4/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
index 79ed860..556d8e4 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
@@ -95,7 +95,7 @@ public class ClientProxyImpl extends AbstractClient implements
     private boolean inheritHeaders;
     private boolean isRoot;
     private Map<String, Object> valuesMap = Collections.emptyMap();
-    
+    private BodyWriter bodyWriter = new BodyWriter();    
     public ClientProxyImpl(URI baseURI,
                            ClassLoader loader,
                            ClassResourceInfo cri, 
@@ -658,6 +658,7 @@ public class ClientProxyImpl extends AbstractClient implements
             if (body != null) {
                 outMessage.put("BODY_INDEX", bodyIndex);
             }
+            outMessage.getInterceptorChain().add(bodyWriter);
     
             Map<String, Object> reqContext = getRequestContext(outMessage);
             reqContext.put(OperationResourceInfo.class.getName(), ori);

http://git-wip-us.apache.org/repos/asf/cxf/blob/1e3a0ac4/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
index f155faa..da42d9d 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
@@ -82,7 +82,7 @@ public class WebClient extends AbstractClient {
     private static final String REQUEST_TYPE = "request.type";
     private static final String RESPONSE_CLASS = "response.class";
     private static final String RESPONSE_TYPE = "response.type";
-    
+    private BodyWriter bodyWriter = new BodyWriter();    
     protected WebClient(String baseAddress) {
         this(convertStringToURI(baseAddress));
     }
@@ -1103,6 +1103,8 @@ public class WebClient extends AbstractClient {
         reqContext.put(RESPONSE_CLASS, responseClass);
         reqContext.put(RESPONSE_TYPE, outGenericType);
         
+        m.getInterceptorChain().add(bodyWriter);
+      
         setPlainOperationNameProperty(m, httpMethod + ":" + uri.toString());
         return m;
     }


Mime
View raw message