final XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(new URL(url)); final XmlRpcTransportFactory transportFactory = new XmlRpcTransportFactory() { public XmlRpcTransport getTransport() { return new MessageLoggingTransport(client); } }; client = new XmlRpcClient(); client.setTransportFactory(transportFactory); client.setConfig(config);
private XmlRpcClient getXmlClient() { XmlRpcClient client = new XmlRpcClient(); URL url; try { url = new URL("http://" + _ip + ":" + _port.toString()); _config.setTimeZone(TimeZone.getTimeZone("UTC")); _config.setServerURL(url); _config.setReplyTimeout(0); // disable, we use asyncexecute to control timeout _config.setConnectionTimeout(6000); _config.setBasicUserName(_username); _config.setBasicPassword(_password); client.setConfig(_config); } catch (MalformedURLException e) { throw new CloudRuntimeException(e.getMessage()); } return client; }
xmlClientConfig.setServerURL(url);
private XmlRpcRequestConfig rpcConfig() throws Exception { XmlRpcClientConfigImpl cfg = new XmlRpcClientConfigImpl(); cfg.setServerURL( url ); return cfg; }
private XmlRpcClientConfig getClientConfig(URL apiURL) { XmlRpcClientConfigImpl config; config = new XmlRpcClientConfigImpl(); config.setServerURL(apiURL); return config; }
public RetriableXmlRpcClient(URL serverUrl, int maxAttempts, long interval) { super(); this.maxAttempts = maxAttempts; this.interval = interval; XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(serverUrl); setConfig(config); }
public static XmlRpcClient getXMLRPCClient(String rpcUrl) throws MalformedURLException { XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(new URL(rpcUrl)); XmlRpcClient client = new XmlRpcClient(); client.setConfig(config); return client; }
public HomeMaticClient(String urlString) throws IOException { URL url = new URL(urlString); XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(url); config.setEnabledForExtensions(true); config.setEncoding("ISO-8859-1"); //only used in modified XmlRpcStreamTransport config.setEnabledForExceptions(true); client = new XmlRpcClient(); client.setConfig(config); this.logger = LoggerFactory.getLogger(getClass().getCanonicalName() + "-" + url.getHost()); }
public Confluence(String endpoint) throws MalformedURLException { if (endpoint.endsWith("/")) { endpoint = endpoint.substring(0, endpoint.length() - 1); } if (!endpoint.endsWith("/rpc/xmlrpc")) { endpoint += "/rpc/xmlrpc"; } XmlRpcClientConfigImpl clientConfig = new XmlRpcClientConfigImpl(); clientConfig.setServerURL(new URL(endpoint)); clientConfig.setEnabledForExtensions(true); client = new XmlRpcClient(); client.setTransportFactory( new XmlRpcAhcTransportFactory(client) ); client.setConfig(clientConfig); }
private XmlRpcClient getXmlRpcClient() { if (xmlRpcClient == null) { final XmlRpcClientConfigImpl xmlrpcConfig = new XmlRpcClientConfigImpl(); xmlrpcConfig.setServerURL(url); xmlRpcClient = new XmlRpcClient(); xmlRpcClient.setConfig(xmlrpcConfig); } return xmlRpcClient; }
private XmlRpcClient getXmlRpcClient() { if (xmlRpcClient == null) { final XmlRpcClientConfigImpl xmlrpcConfig = new XmlRpcClientConfigImpl(); xmlrpcConfig.setServerURL(url); xmlRpcClient = new XmlRpcClient(); xmlRpcClient.setConfig(xmlrpcConfig); } return xmlRpcClient; }
private XmlRpcClient getClient(URL url) { XmlRpcClient client = new XmlRpcClient(); XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(url); client.setConfig(config); return client; }
public static void main(String[] args) throws MalformedURLException { XmlRpcClient xmlRpcClient = new XmlRpcClient(); XmlRpcClientConfigImpl pConfig = new XmlRpcClientConfigImpl(); pConfig.setServerURL(new URL("http://localhost:3300/testlink-1.9.6/lib/api/xmlrpc.php")); xmlRpcClient.setConfig(pConfig); TestProjectService service = new TestProjectService(xmlRpcClient, "09b83b6813a55ef6f7e2d7d63cb6f65c"); Platform[] platforms = service.getProjectPlatforms(2); for (Platform platform : platforms) { System.out.println(platform); } }
public static void main(String[] args) throws MalformedURLException { XmlRpcClient xmlRpcClient = new XmlRpcClient(); XmlRpcClientConfigImpl pConfig = new XmlRpcClientConfigImpl(); pConfig.setServerURL(new URL("http://localhost:3300/testlink-1.9.6/lib/api/xmlrpc.php")); xmlRpcClient.setConfig(pConfig); TestPlanService service = new TestPlanService(xmlRpcClient, "09b83b6813a55ef6f7e2d7d63cb6f65c"); Map<?, ?> message = service.addPlatformToTestPlan(2, 8, "browser"); System.out.println(message); }
@Override public void connectToExternal() throws ComponentException { client = new XmlRpcClient(); XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); try { config.setServerURL(new URL(getConfig().getExternalConnectionString())); client.setConfig(config); } catch (MalformedURLException ex) { LOGGER.error("Exception occurred: {}", ex.toString()); } }
protected <X> X call(String username, String password, String path, String methodName, Object... args) { try { URL url = new URL(getTestBoot().getSettings().getFathomUrl() + StringUtils.removeStart(path, "/")); XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setBasicUserName(username); config.setBasicPassword(password); config.setServerURL(url); XmlRpcClient xmlrpc = new XmlRpcClient(); xmlrpc.setConfig(config); Object x = xmlrpc.execute(methodName, args); return (X) x; } catch (Exception e) { throw new RuntimeException(e); } }
private XmlRpcClient getConfiguredClient() { XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(cUrl); XmlRpcClient client = new XmlRpcClient(); client.setConfig(config); // set this transport factory for host-specific SSLContexts to work XmlRpcCommonsTransportFactory f = new XmlRpcCommonsTransportFactory(client); client.setTransportFactory(f); return client; }
private XmlRpcClient client() { if ( this.client == null ) { XmlRpcClientConfigImpl clientConfig = new XmlRpcClientConfigImpl(); clientConfig.setServerURL( url ); client = new XmlRpcClient(); client.setTransportFactory( new XmlRpcAhcTransportFactory( client ) ); client.setConfig( clientConfig ); } return client; }
public boolean bind() { XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(url); if(username != null && password != null) { config.setBasicUserName(username); config.setBasicPassword(password); } config.setEnabledForExtensions(false); config.setGzipCompressing(false); client.setConfig(config); return true; }
private XmlRpcClient setupClient(FedAgent a, URL url) throws MalformedURLException { XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(url); XmlRpcClient client = new XmlRpcClient(); config.setEnabledForExtensions(true); client.setConfig(config); client.setTypeFactory(new MyTypeFactory(client)); // set this transport factory for host-specific SSLContexts to work XmlRpcCommonsTransportFactory f = new XmlRpcCommonsTransportFactory(client); client.setTransportFactory(f); return client; }