public static File createTempDirectory() throws IOException { File tmpdir = null; try { // TODO: recursive dependency, ohoh ServerConfig config = SPIProvider.getInstance().getSPI(ServerConfigFactory.class).getServerConfig(); tmpdir = new File(config.getServerTempDir().getCanonicalPath() + "/jbossws"); if (!tmpdir.mkdirs()) { tmpdir = null; } } catch (Throwable t) { // Use the Java temp directory if there is no server config (the client) tmpdir = null; } return tmpdir; } }
private String getPortComponentLinkServlet() throws Exception { try { SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); ServerConfig config = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig(); String host = config.getWebServiceHost(); int port = config.getWebServicePort(); String servletURL = "http://" + host + ":" + port + "/jbossws/pclink"; return servletURL; } catch (Exception ex) { throw NativeMessages.MESSAGES.cannotObtainPathToPCLServlet(ex); } }
/** * Returns real http and https protocol values. Returns -1 for non http(s) protocols. * * @param protocol to handle * @return real http(s) value, or -1 if not http(s) protocol */ private int getPortForProtocol( final String protocol ) { final String lowerCasedProtocol = protocol.toLowerCase(); if ( "http".equals( lowerCasedProtocol ) ) { return config.getWebServicePort(); } else if ( "https".equals( lowerCasedProtocol ) ) { return config.getWebServiceSecurePort(); } return -1; }
String host = config.getWebServiceHost(); port = config.getWebServiceSecurePort(); port = config.getWebServicePort();
public String getWebServiceHost() { String res = props.get(WEBSERVICE_HOST); return res != null ? res : serverConfig.getWebServiceHost(); }
public int getWebServicePort() { String res = props.get(WEBSERVICE_PORT); return res != null ? Integer.parseInt(res) : serverConfig.getWebServicePort(); }
File locationFile = new File(serverConfig.getServerDataDir().getCanonicalPath() + "/wsdl/" + archiveName);
public int getWebServiceSecurePort() { String res = props.get(WEBSERVICE_SECURE_PORT); return res != null ? Integer.parseInt(res) : serverConfig.getWebServiceSecurePort(); }
public boolean isModifySOAPAddress() { String res = props.get(MODIFY_SOAP_ADDRESS); return res != null ? Boolean.parseBoolean(res) : serverConfig.isModifySOAPAddress(); }
ServerConfig sc = getServerConfig(); if (sc != null) { ClientConfig cf = configName != null ? sc.getClientConfig(configName) : null; if (cf == null) { cf = sc.getClientConfig(ClientConfig.STANDARD_CLIENT_CONFIG);
String defaultCoordinatorUrl = "http://" + serverConfigValue.getWebServiceHost() + ":" + serverConfigValue.getWebServicePort() + "/" + wscEnVBean.getCoordinatorPath11(); wscEnVBean.setCoordinatorURL11(defaultCoordinatorUrl); wscEnVBean.setBindAddress11(serverConfigValue.getWebServiceHost()); wscEnVBean.setBindPort11(serverConfigValue.getWebServicePort()); wscEnVBean.setBindPortSecure11(serverConfigValue.getWebServiceSecurePort());
public Document getDocumentForPath(URL reqURL, String resPath) throws IOException { String wsdlHost = reqURL.getHost(); boolean rewriteUsingCalledURL = ServerConfig.UNDEFINED_HOSTNAME.equals(config.getWebServiceHost()); if (!rewriteUsingCalledURL) { wsdlHost = config.getWebServiceHost(); } if (log.isDebugEnabled()) log.debug("WSDL request, using host: " + wsdlHost); return getDocumentForPath(reqURL, wsdlHost, rewriteUsingCalledURL, resPath); }
locationFile = new File(serverConfig.getServerDataDir().getCanonicalPath() + "/wsdl/" + archiveName);
private static boolean requiresRewrite(String orgAddress, String uriScheme, ServerConfig config) { if (uriScheme != null) { if (!uriScheme.toLowerCase().startsWith("http")) { //perform rewrite on http/https addresses only return false; } } if (config == null) { SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); config = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig(); } boolean alwaysModify = config.isModifySOAPAddress(); return (alwaysModify || uriScheme == null || orgAddress.indexOf("REPLACE_WITH_ACTUAL_URL") >= 0); }
ServerConfig sc = getServerConfig(); if (sc != null) { ClientConfig cf = sc.getClientConfig(configName); if (cf != null) { return cf;
public ListenerRef createListener(Endpoint endpoint, TransportSpec transportSpec) { if(! (transportSpec instanceof HttpSpec)) throw new IllegalArgumentException("Unknown TransportSpec " + transportSpec); HttpSpec httpSpec = (HttpSpec)transportSpec; SPIProvider provider = SPIProviderResolver.getInstance().getProvider(); ServerConfigFactory spi = provider.getSPI(ServerConfigFactory.class); ServerConfig serverConfig = spi.getServerConfig(); String host = serverConfig.getWebServiceHost(); int port = serverConfig.getWebServicePort(); String hostAndPort = host + (port > 0 ? ":" + port : ""); try { String ctx = httpSpec.getWebContext(); String pattern = httpSpec.getUrlPattern(); ListenerRef ref = new HttpListenerRef( ctx, pattern, new URI("http://"+hostAndPort+ctx+pattern) ); return ref; } catch (URISyntaxException e) { throw new RuntimeException("Failed to create ListenerRef", e); } }
ServerConfig serverConfig = spi.getServerConfig(); host = serverConfig.getWebServiceHost(); port = serverConfig.getWebServicePort(); securePort = serverConfig.getWebServiceSecurePort();
/** Get the temp file for a given namespace */ public static File getSchemaTempFile(String targetNS) throws IOException { if (targetNS.length() == 0) throw MESSAGES.illegalNullArgument("target namespace"); String fname = targetNS; if (fname.indexOf("://") > 0) fname = fname.substring(fname.indexOf("://") + 3); File tmpdir = null; try { SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig(); tmpdir = serverConfig.getServerTempDir(); tmpdir = new File(tmpdir.getCanonicalPath() + "/jbossws"); tmpdir.mkdirs(); } catch (Throwable th) { // ignore if the server config cannot be found // this would be the case if we are on the client side } fname = fname.replace('/', '_'); fname = fname.replace(':', '_'); fname = fname.replace('?', '_'); fname = fname.replace('#', '_'); return File.createTempFile("JBossWS_" + fname, ".xsd", tmpdir); }
/** * Delete the published wsdl */ public void unpublishWsdlFiles() throws IOException { String deploymentDir = (dep.getParent() != null ? dep.getParent().getSimpleName() : dep.getSimpleName()); File serviceDir = new File(serverConfig.getServerDataDir().getCanonicalPath() + "/wsdl/" + deploymentDir); deleteWsdlPublishDirectory(serviceDir); }
final boolean rewriteLocation = ServerConfig.UNDEFINED_HOSTNAME.equals(host) || this.config.isModifySOAPAddress();