|Did you know ...||Search Documentation:|
|CSharp for a .NET 2.0 web service|
Below is a very basic recipe, written in CSharp as a .NET 2.0 web service, which utilizes the System.Diagnostics.Process namespace in order to wrap the plcon.exe and use it as a prolog server. This was all tested in XP Professional, and you need to make sure that you edit the config file as appropriate. Also, you will need to make sure that the impersonation block in the web.config is impersonating a user with read/write priviledges to App_Data.
The Basic tests which were run are as follows:
As tested, this solution appears capable of supporting a few clients reliably. Since it is all packaged in a single web service, you should be able to horizontally scale the solution. The code is in need of further development to make it more robust. Also, the code does not take advantage of the built in threading capability of SWI prolog. So, I think this toy project could be developed further.
Finally, the basic approach can be duplicated in any language which supports OS calls to spawn and manage external processes. The solution is as follows:
I have used the same procedure in Ruby using POPEN and it appears very stable.