[Info-vax] Restful API w/JSON client package or library on OpenVMS
Craig A. Berry
craigberry at nospam.mac.com
Wed Mar 13 19:28:42 EDT 2024
On 3/13/24 5:34 PM, Richard Jordan wrote:
> One of our customers currently on VSI VMS on Integrity has been using
> the GSOAP kit from HP as a client to communicate with a third party app
> on windows server. The company making that product is dropping
> SOAP/GSOAP and moving to only support JSON-based Restful API.
>
> I see several items that purport to provide a Restful API for 'server'
> side use on VMS, like WSIT from VSI. Client mentions seem to be
> relegated to other platforms. Other options seem to be the same; server
> only.
>
> Are there any packages, callable libraries, "Netlib" like options, etc
> that would allow VMS programs to access restful API servers? Whether
> its encapsulation like the GSOAP kits, or just linking in a callable
> library of routines?
>
> Major props if it can be called from BASIC without intervening C or
> other language.
>
> Is VMS Python an option since it looks like Restful API is supported by
> recent versions of that language on VMS? I assume we'd have to get
> BASIC to talk to Python to do the communications in that case...
>
> Thanks for any suggestions or info.
There are basically two pieces to this:
1.) send the GET/POST/PUT/PATCH requests to the HTTP(S) endpoints
2.) parse the JSON that comes back
If you're particularly desperate, you can just use curl to send the
requests and dump the results to something (temp file or whatever), and
then parse the JSON somehow, perhaps with DCL if showing the kids how
things were done in the old days is the main goal. There are currently
better options.
There are plenty of capabilities with both Perl and Python to do #1 and
#2 together. Java too. To do it in BASIC you might need two libraries,
one for HTTP and one for JSON, or one library that does both, and those
libraries would probably be written in C and need wrappers for those
BASIC dynamic strings. Quite likely libcurl has everything you need,
though I've never actually done this kind of implementation with it.
VSI seems to be using Lua for some of its REST API implementations such
as the current web management product. I have no experience with it but
it's yet another way to do the HTTP thing with VMS as the client.
More information about the Info-vax
mailing list