You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ga...@apache.org on 2006/05/16 05:45:27 UTC

svn commit: r406813 - /webservices/axis/trunk/java/src/org/apache/axis/handlers/HandlerChainImpl.java

Author: gawor
Date: Mon May 15 20:45:26 2006
New Revision: 406813

URL: http://svn.apache.org/viewcvs?rev=406813&view=rev
Log:
bad assumption created lots of ClassCastExceptions

Modified:
    webservices/axis/trunk/java/src/org/apache/axis/handlers/HandlerChainImpl.java

Modified: webservices/axis/trunk/java/src/org/apache/axis/handlers/HandlerChainImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/src/org/apache/axis/handlers/HandlerChainImpl.java?rev=406813&r1=406812&r2=406813&view=diff
==============================================================================
--- webservices/axis/trunk/java/src/org/apache/axis/handlers/HandlerChainImpl.java (original)
+++ webservices/axis/trunk/java/src/org/apache/axis/handlers/HandlerChainImpl.java Mon May 15 20:45:26 2006
@@ -31,6 +31,7 @@
 import javax.xml.soap.SOAPEnvelope;
 import javax.xml.soap.SOAPException;
 import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.Node;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
@@ -112,20 +113,24 @@
 
     public ArrayList getMessageInfo(SOAPMessage message) {
         ArrayList list = new ArrayList();
+        if(message == null || message.getSOAPPart() == null) {
+            return list;
+        }
         try {
-            if(message == null || message.getSOAPPart() == null)
-                return list;
             SOAPEnvelope env = message.getSOAPPart().getEnvelope();
             SOAPBody body = env.getBody();
             Iterator it = body.getChildElements();
             SOAPElement operation = (SOAPElement)it.next();
             list.add(operation.getElementName().toString());
             for (Iterator i = operation.getChildElements(); i.hasNext();) {
-                SOAPElement elt = (SOAPElement)i.next();
-                list.add(elt.getElementName().toString());
+                Node node = (Node)i.next();
+                if (node instanceof SOAPElement) {
+                    SOAPElement elt = (SOAPElement)node;
+                    list.add(elt.getElementName().toString());
+                }
             }
         } catch (Exception e) {
-            log.debug("Exception in getMessageInfo : ", e);
+            log.debug("Exception in getMessageInfo", e);
         }
         return list;
     }
@@ -247,4 +252,4 @@
             throw new JAXRPCException(messageText, ex);
         }
     }
-}
\ No newline at end of file
+}