How a PHP Website Interacts Effectively with Java and C #

I have a site written in PHP, the site accepts code fragments written in different programming languages ​​(Java and C #), and performs some static analysis and returns the results to the user. I already wrote different analyzers for Java and C # respectively. The Java parser is written in Java; C # parser is written in C #.

My problem is how the PHP website can interact effectively with parsers written in different languages. That is: when a PHP website receives some Java code, it can call a Java parser, etc. I can, of course, use PHPs exec to start the analyzer process, but it is too slow.

+4
source share
2 answers

I would use web services because they are easily developed, extensible, scalable, platform independent and language independent and support standard HTTP protocols; I'm not sure that you will take full advantage of the benefits of SOA, and this is probably not the best approach, but I would go for it.

Hope this helps.

Web service

Web Services Tutorial

+1
source

In C #, I will host it as a Windows service, and then configure a self-service WCF service configured for REST. Then the web server (PHP) communicates using REST

I think you could do something similar with a Java program, but I don't know how to start it as a service

0
source

Source: https://habr.com/ru/post/1444595/


All Articles