Page 1 of 1

service from inside the socket project

Posted: 30 Jan 2017 14:24
by augustinharrison
intech wrote the socket code for/with me and donated it to your forum for an example. i am now in r&d to use nosql or mongo db. is it possible to call out from the the socket project to a service where i can access either a json or java api ? i will need to continue calling my existing knowledge from the odbc layer already in place and then using some domain abstractions that define my data structures, use the service in question to communicate with the documents using an api.



Posted: 31 Jan 2017 11:45
by Thomas Linder Puls
You cannot call a java api. But you can call a web service (that may or may not be implemented in java), which it appears that MongoDB is.

Sockets is the low-level connection between a web client and a web server, but I would not recommend that you use the sockets directly. Because then you will yourself have to deal with a number of low level stuff like the http-protocol.

In Visual Prolog 7.5 Commercial Edition there are a number of web services examples, all around the same little test service. Most of the examples are concerned with "being" a web service, but "...\webRPC\jsonRpcClient" is a client example. It uses the MSXML component for the actual contact to the service. MSXML offers a number of functions which are very similar to those offered by web-browsers to JavaScript programs.

An alternative may be to use the curl library, but I do not have any experience with that myself.