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); xmlClientConfig.setReplyTimeout(0); xmlClientConfig.setReplyTimeout(60 * 15000); if (hostUser != null && hostPass != null) { LOGGER.debug("Setting username " + hostUser);
config.setEnabledForExtensions(true); config.setConnectionTimeout(60*1000); config.setReplyTimeout(60*1000); XmlRpcClient client = new XmlRpcClient(); client.setTransportFactory(new XmlRpcCommonsTransportFactory(client));
/** * @param uri * the {@link URI} to connect to * @param interfaceClass * the class literal for the XML-RPC interface */ public Client(URI uri, Class<T> interfaceClass) { this.uri = uri; XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); try { config.setServerURL(uri.toURL()); } catch (MalformedURLException e) { throw new RosRuntimeException(e); } config.setConnectionTimeout(CONNECTION_TIMEOUT); config.setReplyTimeout(REPLY_TIMEOUT); XmlRpcClient client = new XmlRpcClient(); client.setTransportFactory(new XmlRpcCommonsTransportFactory(client)); client.setConfig(config); XmlRpcClientFactory<T> factory = new XmlRpcClientFactory<T>(client); xmlRpcEndpoint = interfaceClass.cast(factory.newInstance(getClass().getClassLoader(), interfaceClass, "", XMLRPC_TIMEOUT)); }
config.setEnabledForExtensions(true); config.setConnectionTimeout(60 * 1000); config.setReplyTimeout(60 * 1000);
config.setContentLengthOptional(false); config.setConnectionTimeout(WebUtil.getConnectionTimeout()); config.setReplyTimeout(WebUtil.getSocketTimeout());
private XmlRpcClient getXmlRpcClient( URL url, ConnectionInfo connectionInfo ) { XmlRpcClientConfigImpl clientConfig = new XmlRpcClientConfigImpl(); clientConfig.setServerURL( url ); clientConfig.setEnabledForExceptions( true ); if ( connectionInfo != null ) { clientConfig.setBasicUserName( connectionInfo.getUsername() ); clientConfig.setBasicPassword( connectionInfo.getPassword() ); clientConfig.setBasicEncoding( connectionInfo.getEncoding() ); clientConfig.setGzipCompressing( connectionInfo.isGzip() ); clientConfig.setGzipRequesting( connectionInfo.isGzip() ); clientConfig.setReplyTimeout( connectionInfo.getTimeout() ); clientConfig.setConnectionTimeout( connectionInfo.getTimeout() ); clientConfig.setTimeZone( connectionInfo.getTimeZone() ); } final XmlRpcClient client = new XmlRpcClient(); client.setTypeFactory( new BinderTypeFactory( client ) ); XmlRpcCommonsTransportFactory factory = new XmlRpcCommonsTransportFactory( client ); // Alternative - use simple connection manager, but make sure it closes the connection each time // This would be set here since it would not be thread-safe // factory.setHttpClient( new HttpClient( new SimpleHttpConnectionManager( true ) ) ); factory.setHttpClient( httpClient ); client.setConfig( clientConfig ); return client; }
xmlRpcClientConfig.setReplyTimeout(appConfig.getInt(XMLRPC_REPLY_TIMEOUT)); } catch (ConversionException ce) { this.debug(ce);