1 message in com.googlegroups.google-finance-apis[Google Finance APIs] Proxy setting f...
FromSent OnAttachments
mansonxuMay 5, 2009 4:38 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[Google Finance APIs] Proxy setting for Google Finance Java API?Actions...
From:mansonxu (mans@gmail.com)
Date:May 5, 2009 4:38:04 am
List:com.googlegroups.google-finance-apis

Hi,

I am exploring the google finance java api, exciting stuff. I am not able to run the Demo application when I need to use http web proxy, does anyone how to set proxy for the finance api in order for it to work?

I can run the demo when no proxy is required (i.e. at home), and in other cases I normally use the following codes to specify proxy settings:

System.getProperties().put("http.proxyHost", "someProxyURL"); System.getProperties().put("http.proxyPort", "someProxyPort"); System.getProperties().put("http.proxyUser", "someUserName"); System.getProperties().put("http.proxyPassword", "somePassword");

But even with (and without) the setting above, I still get the following error when trying to run the demo "FinancePortfoliosClient"

Sample Google Finance Portfolios Client Invalid Credentials! com.google.gdata.util.AuthenticationException: Error connecting with login URI at com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken (GoogleAuthTokenFactory.java:479) at com.google.gdata.client.GoogleAuthTokenFactory.setUserCredentials (GoogleAuthTokenFactory.java:336) at com.google.gdata.client.GoogleService.setUserCredentials (GoogleService.java:362) at com.google.gdata.client.GoogleService.setUserCredentials (GoogleService.java:317) at com.google.gdata.client.GoogleService.setUserCredentials (GoogleService.java:301) at FinancePortfoliosClient.loginUser(FinancePortfoliosClient.java: 1054) at FinancePortfoliosClient.main(FinancePortfoliosClient.java:1105) Caused by: java.net.UnknownHostException: www.google.com at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at sun.net.NetworkClient.doConnect(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source) at sun.net.www.protocol.https.HttpsClient.New(Unknown Source) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient (Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect (Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream (Unknown Source) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream (Unknown Source) at com.google.gdata.client.GoogleAuthTokenFactory.makePostRequest (GoogleAuthTokenFactory.java:537) at com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken (GoogleAuthTokenFactory.java:477) ... 6 more Usage: FinancePortfoliosClient <server> <account> <password> Example: FinancePortfoliosClient http://finance.google.com us@gmail.com password

I would really appreciate if anyone can point me at the right direction how to set proxy or use the system proxy setting for Google Finance Java API. Thank you very much.