Author: hemapani Date: Wed Dec 22 06:17:36 2010 New Revision: 1051767 URL: http://svn.apache.org/viewvc?rev=1051767&view=rev Log: fixing https://issues.apache.org/jira/browse/AXIS2-4776
Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java?rev=1051767&r1=1051766&r2=1051767&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java (original) +++ axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java Wed Dec 22 06:17:36 2010 @@ -262,6 +262,12 @@ public class Utils { if (path == null) { return null; } + + //with this chances that substring matching a different place in the URL is reduced + if(!servicePath.endsWith("/")){ + servicePath = servicePath+"/"; + } + int index = path.lastIndexOf(servicePath); String serviceOpPart = null; @@ -269,8 +275,8 @@ public class Utils { int serviceStart = index + servicePath.length(); //get the string after services path - if (path.length() > serviceStart + 1) { - serviceOpPart = path.substring(serviceStart + 1); + if (path.length() > serviceStart) { + serviceOpPart = path.substring(serviceStart); //remove everything after ? int queryIndex = serviceOpPart.indexOf('?');