Creating a service
There are three parts to creating a new service:
- Create a class that contains the business logic
- Create a service that has operations that reference operations to the class's methods
- Create a service group
The service group is a collection of one or more services, and acts as the service reference should we consume it within Visual Studio. We will see how this translates to a URI in the next recipe.
In this example, we will have two service operations: one to get a list of vehicles, and one to update a vehicle's group. The XML documentation has been omitted to save space.
Getting ready
We will just need a Dynamics 365 for Operations visual studio project open.
How to do it...
To create the service, follow these steps:
- First, create a new class that will hold our service methods and name this class
ConWHSVehicleServices
. - The first service will be to update the
Vehicle
service group, for which we have a contract and processing class already created (ConWHSVehicleGroupChangeContract...