21 June 2018

Java HTTP Proxy

A pesar que es trivial muchas veves preguntan lo mismo:

http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html

//System.getProperties().put("proxySet", "false");
  System.getProperties().put("http.proxyHost", captchaProxy);  // con o sin http. funciona :P
  System.getProperties().put("http.proxyPort", captchaPort);

buscar los diferentes metodos...

mirar mi proyecto web-proxy

http://www.coderanch.com/t/384957/java/java/set-proxy-options-command-prompt

http://stackoverflow.com/questions/3957599/how-to-test-proxy-internet-connection-using-java

Proxy class ?

y otros...

con el FTP tb.

---

Sample code shipped:

public static void main(String[] args) throws ServiceException, RemoteException {
String proxyHost = "proxy.oracle.com";
String proxyPort = "8888";
String proxyUsername = "username";
String proxyPassword = "password";

Proxy p = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, Integer.parseInt(proxyPort)));
HttpTransportInfo info = new HttpTransportInfo();
info.setProxy(p);
info.setProxyUsername(proxyUsername.getBytes());
info.setProxyPassword(proxyPassword.getBytes());

GlobalWeather service = new GlobalWeather_Impl("http://www.webservicex.net/globalweather.asmx?wsdl", info);

GlobalWeatherSoap soap = service.getGlobalWeatherSoap();
System.out.println(soap.getCitiesByCountry("Singapore"));


y otros ???



18 June 2018

Modelio 3.6

Second (maybe third) time I hit a bug about Eclipse RCP impl.

TL;DR :

The screen hangs and nothing it is shown/updated

Solution:

-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin
-vmargs


Note:

-vm before -vmargs

- JDK update 131 (and not 160+)

./Contents/Eclipse/modelio.ini

Blog Archive

Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.