Service Group sample (Delphi)
Overview
This example shows how to use Service Group feature.
![](../../../Samples/Delphi/ServiceGroup/server.png)
![](../../../Samples/Delphi/ServiceGroup/client.png)
Getting started
- Build or Compile both projects.
- Launch the server.
- Launch the client.
- Don't change default settings and press
Activate
button on server-side project. -
Test client:
Service1.GetServerTime
will work withServer1
.Service2.Sum
will work withServer2
.
- Press
Deactivate
button on server-side and select other service groups forServer1
&Server2
. - Retest client.
Note: This sample has 5 predefined service groups:
<empty>
- everything is allowedservice1
-service1
group is allowed onlyservice2
-service2
group is allowed only!service1
-service1
group is disallowed. other groups are allowed!service2
-service2
group is disallowed. other groups are allowed
Examine the code
RODL-based server
It has ROServiceGroups
custom attribute that is defined on service level in Service Builder:
![](../../../Samples/Delphi/ServiceGroup/image3.png)
Code-First server
Services have ROServiceGroup
Code-First attribute:
[ROServiceGroup('service1')]
[ROServiceGroup('service2')]