			 	               "Welcome To Ashok IT"				
			                       "Spring Boot & Microservices"
                                             Topic  : Restful Web services
                                              Date  : 30/05/2025
                                                  (Session-56)                          
_____________________________________________________________________________________________________________________________
RestFul & Microservices 
 
 |-> Part-1 (Rest API Development)

Part-1 (Rest API Development)
=============================
1) Distributed Applications

2) Distributed Technologies

3) Webservices and Types of Webservices
      |-> SOAP WebServices
      |-> Restful webservices

4) SOAP Architecture

5) Rest Architecture

6) Differences between SOAP & Rest

7) Use Cases on Restful WebServices

8) Understanding XML and Marshalling(Java Obj -> XML),UnMarshalling(XML -> Java Obj)
        
9) JAXB-API     

10) Understanding JSON and Serialization(Java Obj  -> JSON),DeSerialization(JSON -> Java Obj)
 
11) Jackson-API

12) XML (VS) JSON

13) Http Protocal

14) Http Request & Http Response Structure

15) Http Methods(GET,POST,PUT,PATCH,DELETE....)

16) Http Status Codes & Status Messages

17) Introduction To Spring with Rest.

18) Understanding & Developing Rest Controller in Rest API.

19) Request Mappings

20) Response Entity

21) Request Body and Response Body.

22) Query Parameters 

23) Path Parameters

24) Consumers & Producers

25) Complex Responses

26) Rest API For File Uploading & Downloading

27) Exception Handling in Rest API

28) Swagger Documentation

29) Rest Client Development

30) Rest Client & WebClient

31) Security

32) POSTMAN etc.,

********************************** Rest API Development Completed**********************************

Types of Applications in Java
==============================
* Java is an Programming language we can developed several Kinds of Applications

   1) Standalone Applications

   2) Web Applications

   3) Distributed Applications

1) Standalone Applications
==========================
 * The Applications which are specific to one and only one machine such applications called as "Standalone Applications".

   Examples: Notepad,Notepad++,Firefox,chrome,SQLDeveloper,Eclipse IDE etc.,
 
 * J2SE Libraries (or) JSE Libraries(Thread API,CollectionAPI,IOStreams API,ExceptionHandling API,JDBC API,RMI API)


2) Web Applications
===================
 * The Application which can be available through out globe such applications called as "Web Application".

 * Web Application follow Model called "Client-Server Architectural Model". In this model Client always be fixed as              "Browser".

 * Web Applications are always deals with "Customer to Business Communication".

  Examples: flipkart.com,amazon.com.naukri.com,facebook.com,gmail.com.Irctc,ashokit etc.,

 * J2EE Libraries (or) JEE Libraries (or) Jakarta Libraries(Servlet API,JSP API)

3) Distributed Applications
===========================
 * If One Application is communicating with another Application then they are called as "Distributed Application".

 * Distributed Application are always deals with "Business-to-Business" Communication.

 Example :::::: Filpkart Website(Consumer)  <------------------> Payment Gateway(Payment Services)(Producer)

                AshokIT Portal(Consumer)    <------------------> Payment Gateway(Razor Pay)(Producer)

                AshokIT Portal(Consumer)    <------------------> Weather Application(producer)

                IncomeTax Portal(Consumer)  <------------------> Aadhar Application(Producer)

 * J2EE Libraries,JEE Libararies,Jakarta Libraries(RMI,EJB,WebServices)

 * RMI and EJB are Completed Outdated in Market and Majorly we are using WebServices for developing Distributed Applications.

 * WebServices is an Concept and we do have two models (SOAP WebServices,RestFul WebServices)

 * WebServices are used for establishing Communication between two Applications.

 * WebServices is platform independent and architecture Independent and Language Independent.

WebServices
===========
* Webservices is an concept of establishing the interoperable communication from one application to another application.

* Interoperable communication means irrespective of programming language (or) irrepecitve of Architecture (or) irrespective     of operating system  communication will takes place between two applications.

* In webservices world definetly we required two systems 

    1) The Application whose providing the services to another application called "Producer Application".

    2) The Application whose consuming the services from provider application called "Consumer Application".

* Producer application can be developed in "Java" can be consumed by .net/Java/Python,PHP Application and even viceversa also   possible.

                       Java Application <-----------------------------> .Net Application

                       .Net Application <------------------------------> Java Application

                       Java Application <------------------------------> Python Application

                       Python Application<--------------------------->  Java/.Net Application

Example
=======

      Filpkart.com(Consumer Application) <--------------------------------> Payment Gateway(Producer Application)


* Generally we do have two models in Webservices world

    1) SOAP WebServices

    2) Restful WebServices

1) SOAP WebServices
===================
* SOAP Stands for Simple Object Access Protocal.

* In Soap Webservices basically "Soap Messages" are transferred as part of request body through Http protocal.

* Soap Message is strictly typed or complex XML messages which will be converted from XML content into Java Object and from     Java Object into XML Content using "JAX-B" API.

* The Process of Converting Java Object into XML Content called "Marshalling" and reverse process called as 
  "Un-Marshalling".

   Example
   =======
     Customer c = new Customer();                              <customer>
     c.setCustomerId(123);  					  <customerId>123</customerId>
     c.setCustomerName("Mahesh");                =>		  <customerName>Mahesh</customerName>
     c.setCustomerLocation("Hyderabad");        <=                <customerLocation>Hyderabad</customerLocation>
							       </customer>   

* Basically in Soap based webservices we do have mainly three components

    1) Service Provider (Producer Application)

    2) Service Consumer(Consumer Application)

    3) Service Registry(Soap Webservices to be registered)

* Every Soap Web service is to be registered in Service Registry and Service Provider will maintain services related            information in one xml document i.e.,WSDL(Web Services Descriptor Language File) Document it contains multiple details        Service Class name,Service methods,parameters of method ,request modes etc.,

* We do have multiple API's for developing SOAP Webservices

   1) JAX-RPC(Remote Procedure Call)is the first foremost API released by sun micro system for developing and deploying             webservices in Java.
 
   2) JAX-WS is an Other API as part of JSE Module which can be Used for developing SOAP based Webservices(Apache Axis,Apache       CXF etc.,)

                             **************************************************
                             Example Diagram on Soap Webservices Architecture
                             **************************************************

Limitations of SOAP Webservices
===============================
1) Here we need to maintain the Service Registry is required for publishing and finding the webservices and its very heavy       to maintain.

2) SOAP Messages in http request and http response are complex to build and heavy to send over the network because always        SOAP Messages are formed in the XML format only.

3) As programmer we need to go through WSDL document to understand about webservice information.

4) Constructing the SOAP Messages are complex by the programmer.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++