Using the EMS Pets Client

From RAD Studio
Jump to: navigation, search

Go Up to Tutorial: Using an EMS Client to Access a Custom EMS Resource


The EMS Pets Client application makes calls to the EMS Pets resource in the EMS Server to retrieve the data stored in the Pets.ini file, to add new data or modify it (delete or update it).

The Pets.ini file stores the following information for a given pet (in a single line):

  • Id--Pet identifier (an integer value)
  • Name--Pet's name
  • Kind--Pet's kind of animal

Here is an example of a JSON object that the EMS Pets resource returns after calling an EMS Endpoint method from the EMS Pets client is:

[
    {
    "id":2,
    "kind":"turtle",
    "name":"Crush"
  }
,
  
  {
    "id":3,
    "kind":"Dog",
    "name":"Beethoven"
  }
]


Using the EMS Pets Client

Use the following buttons of the EMS Pets client application to retrieve the data from the EMS Server. The EMS Pets resource returns a list of pets that is stored in the Pets.ini file after each call to an EMS Endpoint method.

  • The Get Pets button returns the list of Pets that the EMS Server has stored in the Pets.ini file.
    EMSPetsClientGetPets.png
  • Get Pet button returns the information of a specific pet (identified with its PetId). Insert an existing Pet identifier in the PetId field.
    EMSPetsClientGetPet.png
  • The Add Pet button adds a new pet to the Pets.ini file in the EMS Server. Insert a new Pet identifier in the Id field and the new Pet's information (in the Name and Kind fields).
    EMSPetsClientAddPet.png
  • The Update Pet button updates the information of a specific pet (identified with its Id). Insert an existing Pet identifier in the Id field and the updated information of the Pet (in the Name and Kind fields).
    EMSPetsClientUpdatePet.png
  • The Delete Pet button deletes all the information of a specific pet (identified with its PetId). Insert an existing Pet identifier in the PetId field.
    EMSPetsClientDeletePet.png

EMS Pets Resource Calls in the EMS Server

You can see the EMS resource endpoints method calls in the RAD Server Engine (EMS Server) log window:

EMSServerPetsLog.png


You can also see the analytics charts in the EMS Console. Run the EMS Console and access the RAD Server Console UI in your browser.

Go to the Analytics section and select the API Calls Endpoints. You can see the API Calls Endpoint of the EMS Pets Resource (select Pets in the drop-down list).

EMSConsolePets.png

See Also