Author: jleroux
Date: Sun Sep 14 08:37:46 2014 New Revision: 1624809 URL: http://svn.apache.org/r1624809 Log: OFBIZ-5770 - Removes the harcoded ports related with service locations introduced with OFBIZ-4794 Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEngine.java ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/XMLRPCClientEngine.java Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEngine.java?rev=1624809&r1=1624808&r2=1624809&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEngine.java Sun Sep 14 08:37:46 2014 @@ -89,10 +89,10 @@ public final class ServiceEngine { for (Element serviceLocationElement : serviceLocationElementList) { String location = serviceLocationElement.getAttribute("location").intern(); if (location.contains("localhost") && Start.getInstance().getConfig().portOffset != 0) { - Integer port = 1099 + Start.getInstance().getConfig().portOffset; - location = location.replace("1099", port.toString()); - port = 8080 + Start.getInstance().getConfig().portOffset; - location = location.replace("8080", port.toString()); + String s = location.substring(location.lastIndexOf(":") + 1); + Integer locationPort = Integer.valueOf(s.substring(0, s.indexOf("/"))); + Integer port = locationPort + Start.getInstance().getConfig().portOffset; + location = location.replace(locationPort.toString(), port.toString()); } serviceLocations.add(new ServiceLocation(serviceLocationElement, location)); } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/XMLRPCClientEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/XMLRPCClientEngine.java?rev=1624809&r1=1624808&r2=1624809&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/XMLRPCClientEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/XMLRPCClientEngine.java Sun Sep 14 08:37:46 2014 @@ -92,8 +92,10 @@ public class XMLRPCClientEngine extends try { url = ServiceConfigUtil.getEngineParameter(engine, "url"); if (Start.getInstance().getConfig().portOffset != 0) { - Integer port = 8080 + Start.getInstance().getConfig().portOffset; - url = url.replace("8080", port.toString()); + String s = url.substring(url.lastIndexOf(":") + 1); + Integer rpcPort = Integer.valueOf(s.substring(0, s.indexOf("/"))); + Integer port = rpcPort + Start.getInstance().getConfig().portOffset; + url = url.replace(rpcPort.toString(), port.toString()); } login = ServiceConfigUtil.getEngineParameter(engine, "login"); password = ServiceConfigUtil.getEngineParameter(engine, "password"); |
Free forum by Nabble | Edit this page |