Web services with SOAP

Shanira Perera
3 min readSep 4, 2022

Hi all, Welcome to another Techie Talk … Today im going to talk about Webservices.

What is Web service?

Web service is a technology to communicate one electronic device to another via using Internet. As an example you go to eCommerce website to purchase some products like wise you use social media to chat with someone. So all these services based one web. There are 2 types of sub parts.

01). SOAP Web Service

02). REST Web Service

SOAP is older than REST but both are popular and using. In java world there are specifications for these services

  • Jax-ws → SOAP
  • Jax-rs → REST

Difference between WEBSITE & WEB SERVICE ?

> Website is meant for Human Consumption

> Web service is meant for Code Consumption

Process of WEB SERVICE

Lets take an example as eCommerce site,

Image of accessing product list by interacting with getProduct method

This application has getProduct method to get the list of products. All these services use this method to process their work. If an external party (user) wants to see some product using the URL in the browser, it interacts with MVC and calls getProduct(); Gets the list of products and sends them back to the user. This is a simple process of a java application.

Now is the part, there were another Application server called “Application Server 02” and it also need to get the product list from the “Application Server 01”. now what to do? see…

Send the App 01 business service by as a JAR file to the App 02

Now what do it app 01 packaging the business service as a JAR file and send it to the app 02 then app 02 can use it functionality but that might not work because app server 01 had a difference database and a different infrastructure. there where another disadvantage of that think app 01 update it version to V2 then again need to repackaging the business service and send to the app 02. but this is not ideal.

The ideal way is for Application Server 02 to directly access the instance of Application Server 01. This is always up to date as this instance has all access to the data. and then it has the latest list of products. this is the web service what does.

What is SOAP web service?

A web service that compiles to the SOAP web services Specification is soap web service.

What are these specifications and who dictates this standards

The W3C (World Wide Web Consortium) dictates the standards.

SOAP Web Services Specifications

SOAP (Simple Object Access Protocol)

SOAP is a set of rules in definition on how to application will talk to each other over the internet.

XML (Extensible Markup Language)

Xml is guy who worked in the middle on Client service consumer and the server service provider. so it exchange all the information/messages over a common format.

XML message have a define structure called SOAP Message. And it consists of Envelope, Header & Body.

Envelope → This is a root element of a soap message and this is the basic unit of XML which contains Header and the body.

Header → It provides the information about the message. and it contains authentication, complex types, routine information…

Body → It contains the actual data of the request that send to the server.

Example of SOAP Message

Hope you learned something.👀 See you on next talk!!!!!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Shanira Perera
Shanira Perera

Written by Shanira Perera

Hello, I’m Shanira, welcome to the world of technology. I am an Associate software engineer at virtusa. So let’s begin!

No responses yet

Write a response