private String addContextRoot(String modifiedURL, String serviceName) { if (!"/".equals(configContext.getContextRoot())) { if (modifiedURL.endsWith(serviceName)) { URI uri = URI.create(modifiedURL); if (!uri.getPath().startsWith(configContext.getContextRoot())) { modifiedURL = modifiedURL.substring(0, modifiedURL.length() - serviceName.length()) + configContext.getContextRoot() + serviceName; } } } return modifiedURL; }
private String internalGetServiceContextPath() { String ctxRoot = getContextRoot(); String path = "/"; if (ctxRoot != null) { if (!ctxRoot.equals("/")) { path = ctxRoot + "/"; } if (servicePath == null || servicePath.trim().length() == 0) { throw new IllegalArgumentException("service path cannot be null or empty"); } else { path += servicePath.trim(); } } return path; }
private String internalGetServiceContextPath() { String ctxRoot = getContextRoot(); String path = "/"; if (ctxRoot != null) { if (!ctxRoot.equals("/")) { path = ctxRoot + "/"; } if (servicePath == null || servicePath.trim().length() == 0) { throw new IllegalArgumentException("service path cannot be null or empty"); } else { path += servicePath.trim(); } } return path; }
private EndpointReference calculateEndpoint(String protocol, String serviceName, String ip) { String portS = context.getProperty("org.osgi.service.http.port"); int port = 80; if (portS != null && portS.length() != 0) { try { port = Integer.parseInt(portS); } catch (NumberFormatException e) {//ignore } } String servicePath = configCtx.getServicePath(); if (servicePath.startsWith("/")) { servicePath = servicePath.substring(1); } String contextRoot = configCtx.getContextRoot(); if (contextRoot == null || contextRoot.equals("/")) { contextRoot = ""; } return new EndpointReference(protocol + "://" + ip + ":" + port + contextRoot + "/" + servicePath + "/" + serviceName + "/"); } }
/** * Hack for Tuscany to get ?wsdl working with Tuscany service names * Can go once moved up to Axis2 1.3 */ private void setContextRoot(String filePart, String serviceName) { String contextRoot = configContext.getContextRoot(); if (contextRoot != null && contextRoot.length() > 0) { if (contextRoot.equals("/")) { configContext.setServicePath("/"); } else { int i = filePart.indexOf(contextRoot) + contextRoot.length(); int j = filePart.lastIndexOf(serviceName); if (i>=j || (i+1 == j)) { configContext.setServicePath("/"); } else { String mapping = filePart.substring(i+1, j); configContext.setServicePath(mapping); } } configContext.setContextRoot(contextRoot); } }
public static String getBackendServerURLHTTP() throws SocketException { return "http://" + NetworkUtils.getLocalHostname() + ":" + CarbonUtils.getTransportPort(BAMUtil.getConfigurationContextService(), "http") + BAMUtil.configurationContextService.getServerConfigContext().getContextRoot(); }
localAddress = localAddress + "/" + context.getContextRoot() + "/" + context.getServicePath() + "/" + WSConstants.GFAC_SERVICE_NAME; log.debug("GFAC_ADDRESS:" + localAddress);
public static String getBackendServerURLHTTPS() throws BAMException { // return "local:/"; try { return "https://" + NetworkUtils.getLocalHostname() + ":" + CarbonUtils.getTransportPort(BAMUtil.getConfigurationContextService(), "https") + BAMUtil.configurationContextService.getServerConfigContext().getContextRoot(); } catch (SocketException e) { throw new BAMException("Cannot get back end https url" , e); } }
protected String getBackendServerURLHTTP() throws SocketException { String contextRoot = ReportingTemplateComponent.getConfigurationContextService().getServerConfigContext().getContextRoot(); return "http://" + NetworkUtils.getLocalHostname() + ":" + CarbonUtils.getTransportPort(ReportingTemplateComponent.getConfigurationContextService(), "http") + contextRoot; }
protected String getBackendServerURLHTTPS() throws SocketException { String contextRoot = ReportingTemplateComponent.getConfigurationContextService().getServerConfigContext().getContextRoot(); return "https://" + NetworkUtils.getLocalHostname() + ":" + CarbonUtils.getTransportPort(ReportingTemplateComponent.getConfigurationContextService(), "https") + contextRoot; } }
log.debug("Successfully obtained the Axis Configuration"); if (axisConfig != null && serverConfigurationContext.getContextRoot() != null) { String contextRoot = serverConfigurationContext.getContextRoot(); log.debug("Found Context Root: " + contextRoot); epBuf.append(contextRoot);
String context = configurationContext.getContextRoot();