Web Services with SOAP

Nafees
4 min readAug 30, 2022

--

Hello Everyone,

Today We can learn about Web Services with SOAP(Simple Object Access Protocol).

What is a Web Service?

A web service is a collection of open protocols and standards used for exchanging data between applications or systems. Software applications written in various programming languages and running on various platforms can use web services to exchange data over computer networks like the Internet in a manner similar to inter-process communication on a single computer. This interoperability (e.g., between Java and Python, or Windows and Linux applications) is due to the use of open standards.

How Does a Web Service Work?

A web service enables communication among various applications by using open standards such as HTML, XML, WSDL, and SOAP. A web service takes the help of −

o XML to tag the data

o SOAP to transfer a message

o WSDL to describe the availability of service.

Types of Web Services

1. SOAP web services.

2. RESTful web services.

SOAP Web Services.

SOAP stands for Simple Object Access Protocol. It is a XML-based protocol for accessing web services.

SOAP is a W3C recommendation for communication between two applications.

SOAP is XML based protocol. It is platform independent and language independent. By using SOAP, you will be able to interact with other programming language applications.

Message Format:

· SOAP message transmits some basic information as given below

· Information about message structure and instructions on processing it.

· Encoding instructions for application defined data types.

· Information about Remote Procedure Calls and their responses.

The Message in XML Format Contains Three Parts

o Envelope:

It specifies that the XML message is a SOAP message. A SOAP message can be defined as an XML document containing header and body encapsulated in the envelope. The fault is within the body of the message.

o Header:

This part is not mandatory. But when it is present it can provide crucial information about the applications.

o Body:

It contains the actual message that is being transmitted. Fault is contained within the body tags.

o Fault:

This section contains the status of the application and also contains errors in the application. This section is also optional. It should not appear more than once in a SOAP message.

Advantages of SOAP

· SOAP is a light weight data interchange protocol because it is based on XML.

· SOAP was designed to be OS and Platform independent.

· It is built on top of HTTP which is installed in most systems.

· It is suggested by W3 consortium which is like a governing body for the Web.

· SOAP is mainly used for Web Services and Application Programming Interfaces (APIs).

SOAP Communication Model

The SOAP Communication model explains a client-server communication protocol to access remote objects.

There are two communication models available in SOAP. There are,

1. Remote Procedure Call (RPC)

2. Document (or Message).

Remote Procedure Call (RPC)

Remote Procedure Call (RPC)

A remote procedure call (RPC)-style Web service appears as a remote object to a client application. The interaction between a client and an RPC-style Web service centers around a service-specific interface. Clients express their request as a method call with a set of arguments, which returns a response containing a return value.

Document (Message)-Style SOAP Services

In the document-style of messaging, the SOAP <Body> contains an XML document fragment. The <Body> element reflects no explicit XML structure. The SOAP run-time environment accepts the SOAP <Body> element as it stands and hands it over to the application it is destined for unchanged. There may or may not be a response associated with this message.

Thank You

Catch up Next One….

--

--

Nafees

Undergraduate Student of University of Jaffna || Associate Software Engineer