Web Service can be active, or only passive (always receive a requisition)

1

How do you call a Web Service (Active, Middleware, Passive, or is it always Web Service?) that sends data to a client or other Web Service when an event occurs on the system to which it belongs?

Example, when there is a change in the status of an order, from "unbilled" to "billed", and I want to send that change to the client or other Web Service. This function is from a Web Service, or is a client function to check every X time, if there was change in the request?

Or should I create another service for this purpose.

    
asked by anonymous 16.10.2018 / 15:16

2 answers

2

Apparently by the description of your doubt this is done with a webhook;

  

What are webhooks?

Every time an event happens in your application, it is responsible for how the information is received in real time.

  

How does it work?

In general webhooks will post the data to you (such as JSON, XML or even form data).

The service provider will make the handling of this information allowing you to often choose how the information is received by your application.

NOTE: most web frameworks now come with a predefined configuration and will make your work easier (search for laravel echo).

  

Simple precautions when using a webhook

  • Webhooks are responsible for data delivery, if there are any errors in your application these data may be lost.

  • Learn how to interpret error messages and how your provider handles the responses of each action, so you can tailor your program to deal with any application errors.

16.10.2018 / 15:37
1

It can be active yes, study Websocket , in short, Websocket is a persistent connection between servers, and clients, the server, whenever there is a change, can send information directly to the clients that are connected.

    
16.10.2018 / 15:35