The question:
Is it possible to run a C++ library on a HTTP server and access it via a web service in another language?
In more detail:
A few years back I did some development work using C# where I connected and used a Web service, I made a connected and accessed the web service methods such as:
var myservice = service.getResults();
Which would return all of the results from the database.. I want to do something similar in C++ in that, I have a C++ library that handles all of the database connections and provides a series of methods in order to access. I now want to open this up to a web method.
The issue:
I don't know how I would go about running this on a HTTP server and accessing using methods that are in different languages? For example, a few of our clients use PHP whereas some use Python. I want to be able to access the methods from each of these languages, so, for example (pseudo code(
PHP:
// Connect to API (Web Service) e.g. http://localhost:8000
$apiClient = new WebService::API();
$results = $apiClient->getResults();
This would then call (in C++):
function getResults()
{
// Run DB query
}
The implementation of the methods I am not struggling with. It's more to do with how do I make this appear on a HTTP server and can I use something like SOAP in order to connect and provide the functionality? I just want hints or resources in order to do this.