Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Communications Framework (ECF) » Using ECF to connect to a session-based JSON-RPC service
Using ECF to connect to a session-based JSON-RPC service [message #625247] Thu, 29 April 2010 16:15 Go to next message
Cole Markham is currently offline Cole MarkhamFriend
Messages: 150
Registered: July 2009
Location: College Station, TX
Senior Member

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 #625248 is a reply to message #625247] Thu, 29 April 2010 22:30 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
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
Previous Topic:Using a jdbc database as backend storage
Next Topic:Using ECF to connect to a session-based JSON-RPC service
Goto Forum:
  


Current Time: Fri Apr 19 01:52:49 GMT 2024

Powered by FUDForum. Page generated in 0.02059 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top