Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ecf-dev] Re: Using ECF to connect to a session-based JSON-RPC service

Scott,

Thanks for your reply, this was exactly what I was looking for.


Scott Lewis wrote:
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/eclipse/ecf/remoteservice/rest/client/package-frame.html

Is a class called:  RestClientService

http://www.eclipse.org/ecf/org.eclipse.ecf.docs/api/org/eclipse/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.
I'll take a look at this and let you know how it goes.
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.
Yes, my colleague, Austin Riddle, is working on getting the org.json bundle in orbit.
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:
I guess the newsgroup I originally posted to is deprecated, I'll post here in the future.
https://dev.eclipse.org/mailman/listinfo/ecf-dev

Thanks,

Scott



Back to the top