cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r639549 - /incubator/cxf/branches/2.0.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptor.java
Date Fri, 21 Mar 2008 05:55:45 GMT
Author: ffang
Date: Thu Mar 20 22:55:28 2008
New Revision: 639549

URL: http://svn.apache.org/viewvc?rev=639549&view=rev
Log:
[CXF-1484]JBI binding should throw more meaningful exception instead of NPE when there is
no operaiton in the JBI MessageExchange

Modified:
    incubator/cxf/branches/2.0.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptor.java

Modified: incubator/cxf/branches/2.0.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptor.java?rev=639549&r1=639548&r2=639549&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptor.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptor.java
Thu Mar 20 22:55:28 2008
@@ -50,18 +50,25 @@
         Exchange ex = message.getExchange();
         Endpoint ep = ex.get(Endpoint.class);
         BindingOperationInfo boi = ex.get(BindingOperationInfo.class);
-        if (boi == null && message.getJbiExchange().getOperation() != null) {
-            BindingInfo service = ep.getEndpointInfo().getBinding();
-            boi = getBindingOperationInfo(service, message.getJbiExchange().getOperation());
-            if (boi == null) {
-                throw new Fault(new Message("UNKNOWN_OPERATION", BUNDLE, 
+        if (boi == null) {
+            if (message.getJbiExchange().getOperation() != null) {
+                BindingInfo service = ep.getEndpointInfo().getBinding();
+                boi = getBindingOperationInfo(service, message.getJbiExchange().getOperation());
+                if (boi == null) {
+                    throw new Fault(new Message("UNKNOWN_OPERATION", BUNDLE, 
                         message.getJbiExchange().getOperation().toString()));
+                }
+                
+            } else {
+                throw new Fault(new Message("UNKNOWN_OPERATION", BUNDLE, 
+                            message.getJbiExchange().getInterfaceName().toString()));
             }
             ex.put(BindingOperationInfo.class, boi);
             ex.put(OperationInfo.class, boi.getOperationInfo());
             ex.setOneWay(boi.getOperationInfo().isOneWay());
             message.put(MessageInfo.class, boi.getInput().getMessageInfo());
         }
+        
     }
 
     protected BindingOperationInfo getBindingOperationInfo(BindingInfo service, QName operation)
{



Mime
View raw message