From 89da32c4e5c5705dcc507d4b43a646c625852380 Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 12 Aug 2010 16:12:49 +0000 Subject: Correct code thats tryng to get at the root element local name so that it works git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@984847 13f79535-47bb-0310-9956-ffa450edef68 --- ...rationSelectorJMSDefaultServiceInterceptor.java | 26 +++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'sca-java-2.x/trunk/modules/binding-jms-runtime') diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/runtime/OperationSelectorJMSDefaultServiceInterceptor.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/runtime/OperationSelectorJMSDefaultServiceInterceptor.java index 149d1c6b4b..e12850c41c 100644 --- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/runtime/OperationSelectorJMSDefaultServiceInterceptor.java +++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/runtime/OperationSelectorJMSDefaultServiceInterceptor.java @@ -121,11 +121,14 @@ public class OperationSelectorJMSDefaultServiceInterceptor implements Intercepto if (xmlPayload != null) { rootElement = domHelper.load(xmlPayload); - operationFromPayload = rootElement.getLocalName(); - for (Operation op : serviceOperations) { - if (op.getName().equals(operationFromPayload)) { - operation = op; - break; + Node firstChild = rootElement.getFirstChild(); + if (firstChild != null) { + operationFromPayload = firstChild.getLocalName(); + for (Operation op : serviceOperations) { + if (op.getName().equals(operationFromPayload)) { + operation = op; + break; + } } } } @@ -137,11 +140,14 @@ public class OperationSelectorJMSDefaultServiceInterceptor implements Intercepto if (bytes != null) { rootElement = domHelper.load(new String(bytes)); - operationFromPayload = rootElement.getLocalName(); - for (Operation op : serviceOperations) { - if (op.getName().equals(operationFromPayload)) { - operation = op; - break; + Node firstChild = rootElement.getFirstChild(); + if (firstChild != null) { + operationFromPayload = firstChild.getLocalName(); + for (Operation op : serviceOperations) { + if (op.getName().equals(operationFromPayload)) { + operation = op; + break; + } } } } -- cgit v1.2.3