What is Webservice?

Gülnur Kurt Durmuş
4 min readJul 12, 2020
Illustration

Web service is a service type that two or more devices and applications can communicate with each other via WWW (World Wide Web). Web services is used to make the application independent from platform and technology. Web services allow various application to connect each other and share data. For example, developed an application on VB or .Net can communicate the web service that created by Java.

Web Service Roles

Web Service Roles

Service Provider: It provides that the service can be available on internet.

Service Requestor: It is a customer which used web service. Requestor can use service via sending an XML messaging over network connection.

Service Registry (UDDI): It is a logically directory of web services. It provides a directory for developer and requestor to describe, find and publish services which is new created or existing one.

Service Description: Sender or receiver of web service must have the same service description because of sending or getting message in true way. As long as sender or receiver have true service description, they can share data each other. They use WSDL (Web Service Description Language)) file for this. This layer describes public interface as specific web service.

An application or device should use some of standards when an application or device share data with other devices or applications.

Some of communication standards are:

  • XML (Extensible Markup Language) provide that people and data-process systems can understand the information easily. It is a standard prepared by W3C provide data exchange among different systems.
  • UDDI stands for Universal Description, Discovery and Integration. UDDI is a detailed describe for distributed registry of web service.
  • Soap stands for Simple Object Access Protocol. Soap is XML-based messaging protocol for sharing data among devices.

The SOAP structure is as follows:

1. Envelope: It is root for SOAP structure. It has Header, Body and Fault tags inside.

2. Header: This part is used to give meta-data for explain context of web service. It is optional.

3. Body: This part is used to get request or send it to service. We must have the body part in service structure. In this part data is sent and getting data is written on XML format.

4. Fault: This part is used for getting error message if error occurred on server side. Occurred error after sending request is shown here.

Calculator Web Service

As you can see on the top, it is an adding method of calculator web service. Header part is empty inside of Envelope tag. Because it is optional, there is no data. In Body part, data is written which will send to service. Sending adding request with two integer numbers is achieved successfully but if decimal number sends, it gives error message in Fault tag. As a result of sending request we get error message in right-side Envelope> Body > Fault.

As you can see below, the process is successful, and we get response in right-side addResult tag.

The web service opened in the web browser is as follows:

Websersvis on Browser (Chrome)

We see the Add method that it has two variables which one of them name is intA and the other name is intB. As a result of request, we get integer data in AddResult tag of AddResponse part.

I tried to explain What is Web Service and How it works?, I hope it will be understandable for you.

Link-1: It has understandable and detailed information about Web Service.

Link-2 : It has detailed information about Web Service.

Link-3 : It is calculator web service that i used.

*** This article originally created for benimuhendisim.com***

--

--