This is part two in my article series about implementing services with “contract first”. Please read the first one for some background information.
Let me give an example. Banks have several different counters. (Or, it was so in the old days, before Internet) One counter is assigned for accounts tasks, other for loans and a third for information and other tasks. We could say that the bank has three different services that they expose to their customers.
This is the same for TSV. They have several services that they expose to their customers.
In our example they are:
- Driving License
- Car Registration
- Information

These services are also a good start to identify as different web services. (This is of course the public web services. TSV could (and probably should) also implement other web services that are used inside the organization.
We now concentrate us on the Driving License Service. This service supports several processes.
The four processes that they have are the following ones:
- Apply for Driving License
- Renew Driving License
- Get information about Driving Licenses
- Terminate a Driving License

A different way to describe this is to draw a use case diagram. In this diagram we also describe the actors that use the processes.
We have two actors:
- Ordinary User - Can only use services that are bound to their own license.
- Privilege User (Police, Administrative personnel, and such) - Can use services that has the user rights to all licenses.

Now we have enough information to make our first wsdl file. (We haven't yet described the information that be passed. This is the topic for the next article in this series.)
I divide the TSV web services in the following way. Each service and role will become its own wsdl file. I call each of them its on service interface (SI).
So in our example we will have the following wsdl's:
- DrivingLicenseUserSI.Wsdl
- DrivingLicensePrivUserSI.Wsdl
- CarRegistrationUserSI.Wsdl
- CarRegistrationPrivUserSI.Wsdl
- InformationUserSI.Wsdl
- InformationPrivUserSI.Wsdl
(The actors for the services Car Registration and Information could be different. I have included them to make the example more complete.)
The DrivingLicenseUserSI defines ApplyForDrivingLicense and RenewDrivingLicense processes and DrivingLicensePrivUserSI defines GetInformationAboutDrivingLicenses and TerminateDrivingLicense.
The reason to have a wsdl for each actor is that it is easier to implement different contract and polices in this way. For example: The processes that only Privilege User could access needs to implement more security. (It could be encryption, authorization.)
In the next article will I drill down in the DrivingLicenseUserSI and show how to describe the information that will be passed to and from the processes.
Comments