Using service agents when calling a web service

Can I explain the use of a service agent during a web service call? How does it fit into the architecture of the project?

+4
source share
1 answer

In MVC aka Model View Controller,

View -> Controller -> Service Agent 

The service agent acts as a proxy for the web service. It can sit at the level of access to resources in your application.

  • The controller initiates the call to the service agent because the view requires some data or needs to perform some operations with the service.
  • After the controller receives the result from the agent, it executes some logic and applies the Model to the view.

EDIT:

The agent wraps the proxy server classes in such a way that it takes care of the implementation of proxy servers and error handling from the server. Proxy classes are common interfaces for a web service, and agents have more logic for related services. For instance. You can translate the answer into the model and return it to the controller.

+2
source

All Articles