[OPEN-ILS-DEV] Which OpenSRF gateway should I use?

Bill Erickson berickxx at gmail.com
Wed Sep 21 10:44:38 EDT 2016


Hi Jane,

I can say unequivocally that you should not use /gateway.  The weird /* */
doodads are not valid JSON.  I'll open a LP bug for deprecating this.

/osrf-gateway-v1 is fine.  I see no reason that it won't be around for the
foreseeable future.  This interface uses a layer of abstraction one step
above OpenSRF, though.  It does not support streaming responses or OpenSRF
sessions (useful for client-driven DB transactions).  The beauty of this
interface is that it's simple to test in a browser (as you have found).

/osrf-http-translator provides a lower level OpenSRF API and supports
streaming responses, but its use is no longer encouraged, because the
underlying mechanism (multipart/x-mixed-replace) is deprecated and only
works with our old version of XULRunner.  This interface will likely be
deprecated along with the XUL client.

/osrf-websocket-translator (from newer versions of EG/OpenSRF) provides a
standard OpenSRF API, streaming responses, etc.  It's new enough, though,
that it's not universally deployed.

WebSockets install docs:
http://evergreen-ils.org/documentation/install/OpenSRF/README_2_4_1.html#_optional_websockets_installation_instructions

Hope this helps,

-b



On Wed, Sep 21, 2016 at 1:33 AM, Jane Sandberg <sandbej at linnbenton.edu>
wrote:

> Hi all,
>
> I am trying to make some HTTP calls to opensrf to get some info about
> copy status, and had my eyes on the OpenSRF gateway.  However, I found
> two different gateways that seem to behave differently, one at
> http://my-domain.org/gateway and another at
> http://my-domain.org/osrf-gateway-v1.
>
> For a simple call, they seem to work the same:
> https://libcat.linnbenton.edu/gateway?service=opensrf.math&
> method=add&param=2&param=2
> https://libcat.linnbenton.edu/osrf-gateway-v1?service=
> opensrf.math&method=add&param=2&param=2
>
> For something a little more complex, the /gateway? calls return some
> JSON with weird /*--*/ doodads that I don't really understand:
> https://libcat.linnbenton.edu/gateway?service=open-ils.cat&
> method=open-ils.cat.asset.copy_tree.retrieve&param=[
> FAKE_SESSION_KEY]&param=294385&param=7
> https://libcat.linnbenton.edu/osrf-gateway-v1?service=open-
> ils.cat&method=open-ils.cat.asset.copy_tree.retrieve&
> param=[FAKE_SESSION_KEY]&param=294385&param=7
>
> My main question: are either of these gateways going away in the
> foreseeable future?
>
> Another question: are there other "gateways" I should be looking at?
> I'm hoping to make actual OpenSRF calls, rather than an abstraction
> like SuperCat or UnAPI, and would greatly prefer using HTTP calls.
>
> Thanks in advance for your help and expertise!
>
>   -Jane
>
>
> --
> Jane Sandberg
> Electronic Resources Librarian
> Linn-Benton Community College
> sandbej at linnbenton.edu / 541-917-4655
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20160921/10919316/attachment-0001.html>


More information about the Open-ils-dev mailing list