cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1404746 - in /cxf/branches/2.6.x-fixes/rt: core/src/main/java/org/apache/cxf/databinding/source/ frontend/jaxws/src/main/java/org/apache/cxf/jaxws/
Date Thu, 01 Nov 2012 20:23:15 GMT
Author: dkulp
Date: Thu Nov  1 20:23:14 2012
New Revision: 1404746

URL: http://svn.apache.org/viewvc?rev=1404746&view=rev
Log:
Merged revisions 1404745 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1404745 | dkulp | 2012-11-01 16:13:26 -0400 (Thu, 01 Nov 2012) | 2 lines

  [CXF-4608] Make sure the correct Source form is used if specified and the operation is given

........

Modified:
    cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
    cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
    cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java

Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java?rev=1404746&r1=1404745&r2=1404746&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
Thu Nov  1 20:23:14 2012
@@ -41,8 +41,15 @@ public class SourceDataBinding extends o
     
     public static final String PREFERRED_FORMAT = "source-preferred-format";
 
+    final Class<?> preferred;
+    
     public SourceDataBinding() {
         super();
+        preferred = null;
+    }
+    public SourceDataBinding(Class<?> pref) {
+        super();
+        preferred = pref;
     }
 
     public void initialize(Service service) {
@@ -67,7 +74,7 @@ public class SourceDataBinding extends o
     @SuppressWarnings("unchecked")
     public <T> DataReader<T> createReader(Class<T> cls) {
         if (cls == XMLStreamReader.class) {
-            return (DataReader<T>) new XMLStreamDataReader();
+            return (DataReader<T>) new XMLStreamDataReader(preferred);
         } else if (cls == Node.class) {
             return (DataReader<T>) new NodeDataReader();
         } else {

Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java?rev=1404746&r1=1404745&r2=1404746&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
Thu Nov  1 20:23:14 2012
@@ -59,14 +59,26 @@ import org.apache.cxf.staxutils.W3CDOMSt
 
 public class XMLStreamDataReader implements DataReader<XMLStreamReader> {
     private static final Logger LOG = LogUtils.getL7dLogger(XMLStreamDataReader.class);
+
+    private final Class<?> preferred;
     private Schema schema;
     private Message message;
     
+    public XMLStreamDataReader() {
+        preferred = null;
+    }
+    public XMLStreamDataReader(Class<?> cls) {
+        preferred = cls;
+    }
+    
     public Object read(MessagePartInfo part, XMLStreamReader input) {
         return read(null, input, part.getTypeClass());
     }
 
     public Object read(final QName name, XMLStreamReader input, Class<?> type) {
+        if (type == null) {
+            type = preferred;
+        }
         if (Source.class.equals(type) && message != null) {
             //generic Source, find the preferred type
             String s = (String)message.getContextualProperty(SourceDataBinding.PREFERRED_FORMAT);

Modified: cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?rev=1404746&r1=1404745&r2=1404746&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
Thu Nov  1 20:23:14 2012
@@ -620,7 +620,7 @@ public class ServiceImpl extends Service
             if (context != null) {
                 db = new JAXBDataBinding(context);
             } else {
-                db = new SourceDataBinding();
+                db = new SourceDataBinding(type);
             }
             sf = createDispatchService(db);
         } catch (ServiceConstructionException e) {



Mime
View raw message