3

I am testing a couple of APIs and am undecided between Zemanta and OpenCalais.

I can use both perfectly at home, but at the company behind the proxy, they won't work, even when running the same examples.

I am running this example and this, both Java.

How can I setup the proxy so it works?

JoshDM
  • 4,939
  • 7
  • 43
  • 72
blueomega
  • 281
  • 2
  • 15

1 Answers1

4

For Zemanta, this is what you need to do before you make the call,

System.setProperty("https.proxyHost", proxyHost);
System.setProperty("https.proxyPort", proxyPort);

Not familiar with Open Calais, you may have to do something different for it to work.

ZZ Coder
  • 74,484
  • 29
  • 137
  • 169
  • odd i tried in calais something like URL url = new URL(u); HttpURLConnection con = (HttpURLConnection)url.openConnection(); System.setProperty("http.proxyHost", "proxy"); System.setProperty("http.proxyPort", "port"); con.setRequestProperty("Proxy-Authorization", "Basic " + base64Encode(new String("user:pass"))); but thx, going to check tomorrow. – blueomega May 24 '10 at 23:36