You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2012/05/13 12:35:28 UTC
svn commit: r1337834 -
/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java
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;
}