omit / linkedin-j

Automatically exported from code.google.com/p/linkedin-j
0 stars 0 forks source link

Exception thrown on multiple calls #27

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a client
2. access a method that communicates with linkedin
3. access a method that communicates with linkedin

What is the expected output? What do you see instead?
Should have no problems, instead the first method works fine, then the
second method throws exceptions LinkedInApiClientException: Stream Closed

What version of the product are you using? On what operating system?
most 0.1rc3 android

Please provide any additional information below.

Original issue reported on code.google.com by dirk.a.s...@gmail.com on 4 May 2010 at 7:23

GoogleCodeExporter commented 9 years ago

Original comment by nabeelmukhtar on 20 May 2010 at 12:17

GoogleCodeExporter commented 9 years ago
I'm having the same problem on Android. Using 0.1rc4 I receive an exception 
that is thrown on any subsequent calls that are after the first call to the API 
client.

Original comment by torbin...@gmail.com on 2 Jul 2010 at 6:38

GoogleCodeExporter commented 9 years ago
Confirmed this issue also exists using the latest build (r310).

Original comment by torbin...@gmail.com on 2 Jul 2010 at 6:59

GoogleCodeExporter commented 9 years ago
Looking at the oauth-signpost project 
(http://code.google.com/p/oauth-signpost/) I found:

"
Google Android
IMPORTANT: Do NOT use the DefaultOAuth* implementations on Android, since 
there's a bug in Android's java.net.HttpURLConnection that keeps it from 
working with some service providers. Instead, use the CommonsHttpOAuth* 
classes, since they are meant to be used with Apache Commons HTTP (that's what 
Android uses for HTTP anyway).

Signpost is already used in several applications running on Android, Google's 
software stack for mobile devices. In fact, Signpost has already signed 
thousands of HTTP requests at this very moment, as it is an integral part of 
Qype Radar, our geo-sensitive mobile application for Android that finds the 
best places near you.
"

I will try to change the library to avoid using the default OAuth 
consumer/provider.

Original comment by torbin...@gmail.com on 3 Jul 2010 at 6:14

GoogleCodeExporter commented 9 years ago
I've managed to successfully replace the DefaultOAuth* consumer/provider with 
CommonstHttpOAuth* consumer/providers and have confirmed that it fixes the bug 
mentioned above for Android. Tested in Android 1.5, 1.6, 2.0 emulators as well 
as on a G1 running Android 1.5.

I could submit a patch containing my changes if you would like to integrate my 
fix. I essentially overrode the LinkedInApiClient callApiMethod() methods to 
provide methods that use the CommonsHttp classes.

Original comment by torbin...@gmail.com on 5 Jul 2010 at 8:51