|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
Registered: July 2009
Cole Markham wrote:
> I am interested in using ECF to connect to a JSON-RPC service
> 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
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
In the org.eclipse.ecf.remoteservice.rest.client package
Is a class called: RestClientService
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:
Powered by FUDForum
. Page generated in 0.09304 seconds