[Info-vax] Restful API w/JSON client package or library on OpenVMS
Dave Froble
davef at tsoft-inc.com
Wed Mar 13 22:19:20 EDT 2024
On 3/13/2024 8:39 PM, Arne Vajhøj wrote:
> On 3/13/2024 6: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...
>
> I know of some options for client for RESTful web services:
> * Java with any HTTP client including builtin HttpURLConnection
> and any JSON library including GSon
> * Python with request and json modules
> * PHP with curl extension and json_encode/json_decode
> * native code with plain sockets and some JSON library
> like cJSON
>
> There are code examples for client in Java, Groovy, Python,
> PHP, C and Pascal here:
> https://www.vajhoej.dk/arne/articles/vmsipc.html#rest
>
> I guess I could come up with a Basic example similar to
> the Pascal example.
>
> But else:
>
> Basic program--(binary/socket)--Java/Groovy/Python gateway
> program--(JSON/HTTP)-->web service
>
> should not be that bad.
>
> Arne
>
>
I have some code that does an HTTPS POST written in Basic. Also have some code
that does a DNS lookup from VMS. Available to whoever asks.
Note, the code uses some code written in C. Some things I don't know how to do
from Basic.
As for Restful, I have no experience. But if you do the POST, you then have the
reply which can be parsed and used.
Never seen any reason to use a bunch of overhead to do a simple operation.
--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef at tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486
More information about the Info-vax
mailing list