cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1404753 - in /cxf/branches/2.5.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:40:57 GMT
Author: dkulp
Date: Thu Nov  1 20:40:57 2012
New Revision: 1404753

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

........
  r1404746 | dkulp | 2012-11-01 16:23:14 -0400 (Thu, 01 Nov 2012) | 10 lines

  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.5.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
    cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
    cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java

Modified: cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java?rev=1404753&r1=1404752&r2=1404753&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
Thu Nov  1 20:40:57 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.5.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java?rev=1404753&r1=1404752&r2=1404753&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
Thu Nov  1 20:40:57 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.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?rev=1404753&r1=1404752&r2=1404753&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
Thu Nov  1 20:40:57 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