0
我需要運行XmlRpc-Request,並且我必須使用代理與服務器連接。如何在沒有settitng的情況下爲XmlRpc請求使用代理Systemproperties
該連接使用下面的代碼。
try {
final XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(new URL(url));
final XmlRpcClient server = new XmlRpcClient();
server.setConfig(config);
Object result = null;
System.setProperty("https.proxyHost", host);
System.setProperty("https.proxyPort", port);
result = server.execute("evatrRPC", params);
return ((String) result);
}catch (final Exception exception) {
throw new RuntimeException("JavaClient: " + exception);
}
問題是我不允許更改系統屬性。因此,我正在尋找其他方式來爲請求設置代理。
謝謝您的幫助