cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r546745 - /incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ProviderInDatabindingInterceptor.java
Date Wed, 13 Jun 2007 06:09:42 GMT
Author: jliu
Date: Tue Jun 12 23:09:41 2007
New Revision: 546745

URL: http://svn.apache.org/viewvc?view=rev&rev=546745
Log:
Fix NoSuchElementException in ProviderInDatabindingInterce.

Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ProviderInDatabindingInterceptor.java

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ProviderInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ProviderInDatabindingInterceptor.java?view=diff&rev=546745&r1=546744&r2=546745
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ProviderInDatabindingInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ProviderInDatabindingInterceptor.java
Tue Jun 12 23:09:41 2007
@@ -41,7 +41,7 @@
 public class ProviderInDatabindingInterceptor extends AbstractInDatabindingInterceptor {
 
     Class type;
-    
+
     public ProviderInDatabindingInterceptor(Class type) {
         super(Phase.UNMARSHAL);
         addAfter(URIMappingInterceptor.class.getName());
@@ -51,20 +51,22 @@
     public void handleMessage(Message message) throws Fault {
         Exchange ex = message.getExchange();
         Endpoint e = ex.get(Endpoint.class);
-        BindingOperationInfo bop = e.getEndpointInfo().getBinding().getOperations().iterator().next();
-        ex.put(BindingOperationInfo.class, bop);
-        getMessageInfo(message, bop);
-        
+        if (e.getEndpointInfo().getBinding().getOperations().iterator().hasNext()) {
+            BindingOperationInfo bop = e.getEndpointInfo().getBinding().getOperations().iterator().next();
+            ex.put(BindingOperationInfo.class, bop);
+            getMessageInfo(message, bop);
+        }
+
         List<Object> params = new ArrayList<Object>();
-        
+
         if (isGET(message)) {
             params.add(null);
             message.setContent(Object.class, params);
             return;
         }
-        
+
         Service s = ex.get(Service.class);
-        
+
         if (SOAPMessage.class.equals(type)) {
             SOAPMessage msg = message.getContent(SOAPMessage.class);
             params.add(msg);
@@ -74,14 +76,14 @@
             if (r != null) {
                 if (r instanceof W3CDOMStreamReader) {
                     Node nd = ((W3CDOMStreamReader)r).getCurrentElement();
-                    DataReader<Node> reader = 
+                    DataReader<Node> reader =
                         s.getDataBinding().createReader(Node.class);
                     Object object = reader.read(null, nd, type);
                     params.add(object);
                 } else {
-                    DataReader<XMLStreamReader> reader = 
+                    DataReader<XMLStreamReader> reader =
                         s.getDataBinding().createReader(XMLStreamReader.class);
-                    
+
                     Object object = reader.read(null, r, type);
                     params.add(object);
                 }



Mime
View raw message