jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1337834 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java
Date Sun, 13 May 2012 10:35:28 GMT
Author: pmouawad
Date: Sun May 13 10:35:28 2012
New Revision: 1337834

URL: http://svn.apache.org/viewvc?rev=1337834&view=rev
Log:
Fix ArrayIndexOutOfBoundException risk introduced by last commit

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java?rev=1337834&r1=1337833&r2=1337834&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java Sun
May 13 10:35:28 2012
@@ -143,22 +143,26 @@ public class WSDLHelper {
                 ports = node.getElementsByTagName("wsdl:port");
             }
             
-            Element pnode = (Element) ports.item(0);
-            // NOTUSED String portname = pnode.getAttribute("name");
-            // used to check binding, but now it doesn't. it was
-            // failing when wsdl did not using binding as expected
-            NodeList servlist = pnode.getElementsByTagName("soap:address");
-            // check wsdlsoap
-            if (servlist.getLength() == 0) {
-                servlist = pnode.getElementsByTagName("wsdlsoap:address");
-            }
-            if (servlist.getLength() == 0) {
-                servlist = pnode.getElementsByTagName("SOAP:address");
-            }
-            Element addr = (Element) servlist.item(0);
-            this.SOAPBINDING = addr.getAttribute("location");
-            this.bindingURL = new URL(this.SOAPBINDING);
-            return this.SOAPBINDING;
+            if(ports.getLength()>0) {
+                Element pnode = (Element) ports.item(0);
+                // NOTUSED String portname = pnode.getAttribute("name");
+                // used to check binding, but now it doesn't. it was
+                // failing when wsdl did not using binding as expected
+                NodeList servlist = pnode.getElementsByTagName("soap:address");
+                // check wsdlsoap
+                if (servlist.getLength() == 0) {
+                    servlist = pnode.getElementsByTagName("wsdlsoap:address");
+                }
+                if (servlist.getLength() == 0) {
+                    servlist = pnode.getElementsByTagName("SOAP:address");
+                }
+                Element addr = (Element) servlist.item(0);
+                this.SOAPBINDING = addr.getAttribute("location");
+                this.bindingURL = new URL(this.SOAPBINDING);
+                return this.SOAPBINDING;
+            } else {
+                return null;
+            }
         } catch (Exception exception) {
             return null;
         }



Mime
View raw message