简体   繁体   中英

Integration between Webservices and Website

I have some web services running on a central server(Debian) on Apache. I have multiple remote machines which call these webservices. One of the webservice is a status/healthcheck webservice - each remote machine has a cronjob which calls the status webservice every minute. Basically the point of this status webservice is to send requests back to the machines as a response to the status webservice.

I also have a website running on the same central server. I want to have communication between the status webservice & the website.

ie someone can click on an option on the website & ask to send request 'X' to Remote Machine 'Y'. If the webservice were a running process, the website would just communicate this to the webservice & the webservice would send this next time it gets a status call from that Machine.

However, since the webservice is not a process - I am confused as to how I can achieve this - does anyone have any suggestions.

Everything is running on Apache/PHP.

You can have a DB table with these fields: id, request, remote_machine, processed and save the request from the website here immediately.

Later when each time the remote machines call the health check web service, it can query that table for request matching the remote machine and processed = 0. It can then send the request as a response to the health check web service.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM