}
XblWriterFactory writerFactory = new XblWriterFactory(useCDATA);
xmlRpcClient.setXmlWriterFactory(writerFactory);
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
int val = address.getEnv("responseTimeout", 0).getValue();
if (val > 0)
config.setReplyTimeout(val);
val = address.getEnv("SoTimeout", 0).getValue();
if (val > 0)
config.setConnectionTimeout(val);
String compressType = address.getEnv("compress/type", "").getValue();
if (Constants.COMPRESS_ZLIB.equals(compressType) || Constants.COMPRESS_ZLIB_STREAM.equals(compressType))
config.setGzipCompressing(true);
else
config.setGzipCompressing(false);
String proxyHost = address.getEnv("proxyHost", (String)null).getValue();
String proxyPort = address.getEnv("proxyPort", (String)null).getValue();
if (proxyPort != null && proxyPort.length() > 0 && proxyHost == null)
proxyHost = "localhost";
String proxyHostSSL = address.getEnv("proxyHostSSL", proxyHost).getValue();
String proxyPortSSL = address.getEnv("proxyPortSSL", proxyPort).getValue();
Properties props = System.getProperties();
synchronized(props) {
if (proxyHost != null)
props.setProperty("http.proxySet", "true");
if (proxyHostSSL != null)
props.setProperty("https.proxySet", "true");
setProp(props, "http.proxyHost", proxyHost);
setProp(props, "http.proxyPort", proxyPort);
setProp(props, "https.proxyHost", proxyHostSSL);
setProp(props, "https.proxyPort", proxyPortSSL);
}
String basicUserName = address.getEnv("basicUserName", null).getValue();
String basicPassword = address.getEnv("basicPassword", null).getValue();
String basicEncoding = address.getEnv("basicEncoding", null).getValue();
String userAgent = address.getEnv("userAgent", null).getValue();
if (basicUserName != null)
config.setBasicUserName(basicUserName);
if (basicPassword != null)
config.setBasicPassword(basicPassword);
if (basicEncoding != null)
config.setBasicEncoding(basicEncoding);
if (userAgent != null)
config.setUserAgent(userAgent);
config.setEnabledForExceptions(true);
config.setEnabledForExtensions(true);
String url = null;
if (xmlRpcUrl == null) {
url = address.getRawAddress();
xmlRpcUrl = new XmlRpcUrl(glob, url);
}
else
url = xmlRpcUrl.getUrl();
boolean isSSL = url.indexOf("https://") == 0;
config.setServerURL(new URL(url));
xmlRpcClient.setConfig(config);
XmlRpcTransportFactory transportFactory = xmlRpcClient.getTransportFactory();
if (transportFactory instanceof XmlRpcSun15HttpTransportFactory) {