In this blog we will discuss simple custom service with normal parameters and with List parameters:
Normal Request Service:
1. Create a contract a class and add elements which you want to pass as parameters to get request:
2. Create a service and add the created method ( In operation class ) to it and add following properties:
3. Create a group service and add your created service in it and add following properties:
4. Create an Operation class to add your business logic in it
If there is List of contracts and list used for requests through custom service then below mentioned classes can be used:
LIST Request-Response Service:
Above is the simple get list of order contract class and below mentioned is update list of orders
Below mentioned service class for GET request-list of orders:
Below mentioned service class is for UPDATE - PATCH list of orders:
Below is the response contract for list of orders which will be updated:
Below mentioned sample Postman body for list of orders:
HEY HEY HEY !!! HACK OF THE DAY !!!
Always remember to add AIF COLLECTION
While Using List as the return type.
Comments
Post a Comment