Using ECF to connect to a session-based JSON-RPC service [message #530445] |
Thu, 29 April 2010 16:15 |
|
I am interested in using ECF to connect to a JSON-RPC service (http://qikapi.pbworks.com/).
Also the server requires a sessionId to be created and used for all subsequent api calls. I found a newsgroup post from February of 2009 (over a year ago) which mentioned it would be possible, but wasn't done at that time.
Has any work been done on either of these fronts that I might be able to leverage?
Thanks,
Cole
|
|
|
Re: Using ECF to connect to a session-based JSON-RPC service [message #530520 is a reply to message #530445] |
Thu, 29 April 2010 22:30 |
Scott Lewis Messages: 1038 Registered: July 2009 |
Senior Member |
|
|
Hi Cole,
Cole Markham wrote:
> I am interested in using ECF to connect to a JSON-RPC service
> (http://qikapi.pbworks.com/).
> Also the server requires a sessionId to be created and used for all
> subsequent api calls. I found a newsgroup post from February of 2009
> (over a year ago) which mentioned it would be possible, but wasn't done
> at that time.
>
> Has any work been done on either of these fronts that I might be able to
> leverage?
In a word, yes.
Last fall the REST API work done during the google soc 2009 was
refactored so that it would be possible to create rest providers that
could extend or customize the default behavior of the existing rest
provider. Specifically, here are the javadocs for all the ecf apis
http://www.eclipse.org/ecf/org.eclipse.ecf.docs/api/
In the org.eclipse.ecf.remoteservice.rest.client package
http://www.eclipse.org/ecf/org.eclipse.ecf.docs/api/org/ecli pse/ecf/remoteservice/rest/client/package-frame.html
Is a class called: RestClientService
http://www.eclipse.org/ecf/org.eclipse.ecf.docs/api/org/ecli pse/ecf/remoteservice/rest/client/RestClientService.html
One thing you can/could easily do is to create a subclass of this class
for your own, new, provider, and override the methods in this
class...specifically, invokeRemoteCall (which synchronously actually
makes the http request and...using httpclient 3.1.0), or methods that
are called within invokeRemoteCall. So, for example, you should be able
to specify a given sessionid.
You will likely have to also extend RestClientContainer (because this
class creates the RestClientService instance and so the type of
RestClientService is bound to the type of the RestClientContainer). But
this is not too much of a problem, given that when creating an ECF
provider one typically creates a given type of container anyway.
Also...BTW...ECF SDK includes the org.json parser code (in the org.json
bundle), and we have test code that uses the twitter API/json. So using
json is done very easily...all necessary code is there.
If this is unclear or more info desired...or more questions...please
move this discussion to ecf-dev at eclipse.org so that (more) others can
benefit. Go here to join the mailing list if you haven't already:
https://dev.eclipse.org/mailman/listinfo/ecf-dev
Thanks,
Scott
|
|
|
Powered by
FUDForum. Page generated in 0.03328 seconds