axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asan...@apache.org
Subject svn commit: r465295 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSUtils.java
Date Wed, 18 Oct 2006 16:50:05 GMT
Author: asankha
Date: Wed Oct 18 09:50:01 2006
New Revision: 465295

URL: http://svn.apache.org/viewvc?view=rev&rev=465295
Log:
allow string parameters specifying the QNames to be properly understood

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSUtils.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSUtils.java?view=diff&rev=465295&r1=465294&r2=465295
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSUtils.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSUtils.java
Wed Oct 18 09:50:01 2006
@@ -373,7 +373,7 @@
                 Parameter operationParam = msgContext.getAxisService().
                     getParameter(JMSConstants.OPERATION_PARAM);
                 QName operationQName = (operationParam != null ?
-                    (QName) operationParam.getValue() : JMSConstants.DEFAULT_OPERATION);
+                    getQName(operationParam.getValue()) : JMSConstants.DEFAULT_OPERATION);
 
                 AxisOperation operation = msgContext.getAxisService().getOperation(operationQName);
                 if (operation != null) {
@@ -387,7 +387,7 @@
                 Parameter wrapperParam = msgContext.getAxisService().
                     getParameter(JMSConstants.WRAPPER_PARAM);
                 QName wrapperQName = (wrapperParam != null ?
-                    (QName) wrapperParam.getValue() : JMSConstants.DEFAULT_WRAPPER);
+                    getQName(wrapperParam.getValue()) : JMSConstants.DEFAULT_WRAPPER);
 
                 OMElement wrapper = soapFactory.createOMElement(wrapperQName, null);
 
@@ -442,6 +442,22 @@
                 "SOAP message");
         }
         return envelope;
+    }
+
+    private static QName getQName(Object obj) {
+        String value;
+        if (obj instanceof QName) {
+            return (QName) obj;
+        } else {
+            value = obj.toString();
+        }
+        int open = value.indexOf('{');
+        int close = value.indexOf('}');
+        if (close > open && open > -1 && value.length() > close)
{
+            return new QName(value.substring(open+1, close-open), value.substring(close+1));
+        } else {
+            return new QName(value);
+        }
     }
 
     private static void handleException(String s) {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message