Repository: camel
Updated Branches:
  refs/heads/master 8f8e2f033 -> b80b11903


CAMEL-7783 Fixed the issue that ConsumerWSAEndpointMappingRouteTest fails with 
JDK8


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

Branch: refs/heads/master
Commit: b80b1190387b13c6fd545790ceb2c53ab593bafe
Parents: 8f8e2f0
Author: Willem Jiang <willem.ji...@gmail.com>
Authored: Mon Sep 8 16:25:13 2014 +0800
Committer: Willem Jiang <willem.ji...@gmail.com>
Committed: Mon Sep 8 16:25:13 2014 +0800

----------------------------------------------------------------------
 .../spring/ws/bean/WSACamelEndpointMapping.java | 29 +++++++++++++++-----
 1 file changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b80b1190/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/WSACamelEndpointMapping.java
----------------------------------------------------------------------
diff --git 
a/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/WSACamelEndpointMapping.java
 
b/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/WSACamelEndpointMapping.java
index ceabf97..f656145 100644
--- 
a/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/WSACamelEndpointMapping.java
+++ 
b/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/WSACamelEndpointMapping.java
@@ -54,21 +54,15 @@ public class WSACamelEndpointMapping extends 
AbstractAddressingEndpointMapping i
 
     @Override
     protected Object getEndpointInternal(MessageAddressingProperties map) {
+        // search the endpoint with compositeKeyFirst
         for (EndpointMappingKey key : endpoints.keySet()) {
             String compositeOrSimpleKey = null;
-            String simpleKey = null;
             switch (key.getType()) {
             case ACTION:
                 compositeOrSimpleKey = getActionCompositeLookupKey(map);
-                if (map.getAction() != null) {
-                    simpleKey = map.getAction().toString();
-                }
                 break;
             case TO:
                 compositeOrSimpleKey = getToCompositeLookupKey(map);
-                if (map.getTo() != null) {
-                    simpleKey = map.getTo().toString();
-                }
                 break;
             default:
                 throw new RuntimeCamelException(
@@ -80,6 +74,27 @@ public class WSACamelEndpointMapping extends 
AbstractAddressingEndpointMapping i
                 LOG.debug("Found mapping for key" + key);
                 return endpoints.get(key);
             }
+        }
+        
+        // look up for the simple key
+        for (EndpointMappingKey key : endpoints.keySet()) {
+            String simpleKey = null;
+            switch (key.getType()) {
+            case ACTION:
+                if (map.getAction() != null) {
+                    simpleKey = map.getAction().toString();
+                }
+                break;
+            case TO:
+                if (map.getTo() != null) {
+                    simpleKey = map.getTo().toString();
+                }
+                break;
+            default:
+                throw new RuntimeCamelException(
+                                                "Invalid mapping type 
specified. Supported types are: spring-ws:action:<WS-Addressing 
Action>(optional:<WS-Addressing To>?<params...>\n)"
+                                                    + 
"spring-ws:to:<WS-Addressing To>(optional:<WS-Addressing Action>?<params...>)");
+            }
             // look up for less specific endpoint
             if (simpleKey != null && key.getLookupKey().equals(simpleKey)) {
                 LOG.debug("Found mapping for key" + key);

Reply via email to