You are on page 1of 4

Assignment 4

Service Oriented Distributed Systems

This assignment is about implementing a distributed system that uses web services to
expose the server functionalities to its clients. We had to do an application called ‘Online
Tracking System’ that exposes the following functionality to its users:
- Two types of users: administrator and client
- After login, the user is redirected to its corresponding page
- If the user does not have an account, it can register and become a simple user
- The administrator can: add/remove a package, register a package for tracking
and update package status
- The client can: list all its packages, search for certain packages, check package
status
These functionalities had to be exposed as 2 web services: one SOAP Web Service in
.NET and the other one in Java. The GUI could be either Web or Desktop. I chose the second
option.

Service-oriented architecture is a way of providing services to other clients through a


communication protocol, over a network. Loose coupling describes best this kind of
architecture. Between web services and the client invoking them there should be as less
dependency as possible. Services show to the outside world only what they do, but not
how(encapsulation). Services should be stateless, that is, they do not have to keep
information from one state to another. Services are published in a registry from where they
are available to anyone.
SOAP(Simple Object Access Protocol) provides a protocol for sending messages over
a network. SOAP envelope contains two parts: an optional header and a body that contains
the message. Messages can be defined using WSDL(Web Service Description Language)
specification. The steps involved in providing and consuming a service are:
- A service provider describes its service using WSDL. This definition is
published to a repository of services. The repository could use Universal
Description, Discovery, and Integration (UDDI).
- A service consumer issues one or more queries to the repository to locate a
service and determine how to communicate with that service.
- The service consumer uses the WSDL to send a request to the service
provider.
- The service provider provides the expected response to the service consumer.
With this protocol, platform independence is provided. The client communicate with
the service provider only through XML files. In this way, the provider can be implemented in
a different language from the client. This is the case of our project, when one of the services
was implemented in .NET and the client in Java.
I wrote the service that provides administrator operations and logIn in Java and the
service for client operation in .NET. Some additional services were also necessary and those
were also place in Java.
In what follows I will describe the services. In Java I have the following classes that
implement services: Authenticate(log in part), CreateAccount, CreatePackage,
FindAllPackages, FindAllRoutes, FindAllUsers(these are for GUI), FindUser,
RegisterPackage, RemovePackage, UpdateStatus. All classes implement an interface that is
annotated with ​@WebService​ and have only one method annotated with ​@WebMethod​. Each
service is then published with ​Endpoint.publish()​ method on a certain address. For example:
“​http://localhost:7999/CreatePackage”.​ The client can then generate Java code from WSDL
file located at ​http://localhost:7999/CreatePackage?​ wsdl. Behind these services there are
simple CRUD operations.
On the .NET side, the things follow the same principles. A service is written and then
published at a certain address. The annotations here are the following: [ServiceContract] for
the interface and [OperationContract] for each method that is to be implemented. Please refer
to the source codes for more details.
The user interface is desktop and it is written in Java. There are text fields, buttons,
and tables with which user can do all operations described above.

Figure 1: Admin page


Deployment diagram

Conceptual Diagram
Build and execution

1. Open the 3 projects: DotNetClientWebService, JavaWebService and User.


2. Start the service providers.
3. When they are running, start the user. Introduce your credentials and use the app:
either as a client or an admin.

Student: Fărcaș Cristian - Teodor


Group: 30441

You might also like