0% found this document useful (0 votes)
13 views

Lesson 11 - SOA and Web Services

The document discusses service-oriented architecture (SOA) and web services. It explains the phases of software evolution, SOA architecture, advantages of SOA, and implementing SOA with an example. It also covers topics like what is SOA, creating SOAP and RESTful web services.

Uploaded by

telecomdepart8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Lesson 11 - SOA and Web Services

The document discusses service-oriented architecture (SOA) and web services. It explains the phases of software evolution, SOA architecture, advantages of SOA, and implementing SOA with an example. It also covers topics like what is SOA, creating SOAP and RESTful web services.

Uploaded by

telecomdepart8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 74

Advanced Java

Lesson 11—SOA and Web Services

© Simplilearn. All rights reserved.


Learning Objectives

Explain SOA Architecture

Explain Web Services

List the steps to create a SOAP based Web Service

List the steps to create a RESTful Web Service


SOA and Web Services
Topic 1—Basics of SOA and SOA Architecture

• Phases of Software Evolution


• What is SOA?
• Advantages of SOA
• SOA Architecture
• Implementing SOA: Example
• SOA Service Description
• Web Service as Implementation of SOA
Phases of Software Evolution

The software evolution has distinct phases. These layers are built up one by one over many years.

Software evolution begins with understanding the concept of 1 and 0 (bits) that gives rise to
machine language. This is followed by assembly, procedure oriented, object oriented, component
oriented, and service oriented languages.

Structured
Oriented/Procedure Object Component Service
Oriented Oriented Oriented Oriented

https://www.researchgate.net/publication/215571061
Phases of Software Evolution
STRUCTURE ORIENTED/PROCEDURE ORIENTED

Structure A procedural language is a type of computer programming language that specifies a series of
Oriented/Procedure
well-structured steps and procedures within its programming context to compose a program.
Oriented
It contains a systematic order of statements, functions, and commands to complete a
Object
computational task or program.
Oriented

Component
Oriented

Service
Oriented
Phases of Software Evolution
STRUCTURED ORIENTED/PROCEDURE ORIENTED LANGUAGE: LIMITATIONS

Structured
Oriented/Procedure • Structure/procedure oriented language is unable to model real world problems.
Oriented
• It uses global data concept and is thus accessed by all the functions.
Object
Oriented • It is difficult to maintain because the line of code is high.

Component
Oriented

Service
Oriented
Phases of Software Evolution
OBJECT ORIENTED

Structured
Oriented/Procedure It refers to a type of computer programming (software design) in which the
Oriented programmers define the data type of a data structure and the types of operations (functions)
that can be applied to the data structure.
Object
Oriented

Component
Oriented

Service
Oriented
Phases of Software Evolution
OBJECT ORIENTED: LIMITATIONS

Structured Although it offers better implementation, data security, code reusability, and flexibility, It is
Oriented/Procedure
difficult to manage complex applications.
Oriented

Object
Oriented

Component
Oriented

Service
Oriented
Phases of Software Evolution
COMPONENT ORIENTED

Structured Component-based software engineering (CBSE), also called component-based development


Oriented/Procedure
(CBD), is a branch of software engineering that emphasizes the separation of concerns with
Oriented
respect to the wide-ranging functionality available throughout a given software system.
Object
Oriented A component modifies complexity through the use of a component container and its services.

Component
Oriented

Service
Oriented
Phases of Software Evolution
COMPONENT ORIENTED: LIMITATIONS

Structured
Component development is a complex task and comes with the following limitations:
Oriented/Procedure
Oriented
• Component maintenance costs
Object
• Reliability and sensitivity to changes
Oriented
• Unsatisfied requirements
Component
Oriented

Service
Oriented
Phases of Software Evolution
SERVICE ORIENTED

Structured Web Services are self-describing services that will perform well-defined tasks and can be accessed
Oriented/Procedure through the Web.
Oriented
Service Oriented approach follows an architecture, called SOA (Service Oriented Architecture), that
Object focuses on building systems through the use of different Web Services and integrating them to
Oriented make up the whole system.

Component
Oriented

Service
Oriented
What is SOA?
AN ARCHITECTURAL SOLUTION

SOA is the architectural solution for integrating diverse systems by providing an architectural style that
promotes loose coupling reuse.

It is a programming model or paradigm where web service and contracts becomes a dominant design for
interoperability
SOA Architecture

Processes
Discovery, Aggregation, Choreography…

Base Technologies: XML, DTD, Schema


Base Technologies: XML, DTD, Schema
Descriptions
Web Services Descriptions (WSDL)

Messages

Management
Security

SOAP Extensions
Reliability, Correlation, Transactions….

SOAP

Communications
HTTP, SMTP, FTP, JMS, IIOP
What Is SOA?
A COLLECTION OF SERVICES

SOA is a collection of Services.

The following diagram shows how an Online Shopping website selling gadgets is involved with different
services like Ordering, Tracking, and Checkout to give service to its customers.

Ordering
Service

Tracking
Service

Customers
Online shopping website Checkout
selling gadget Service
What Is SOA?
ESTABLISHING COMMUNICATION

It helps in establishing communication between all services (applications).

SOA
Service Consumer Service Provider
SOA is a solution for making
two software communicate to
each other
Advantages of SOA

SOA Services Uses


Service • Improved information flow
• Ability to expose internal functionality
• Organizational flexibility
Service Re-use Lower software development and management costs
Messaging Configuration flexibility
Message Monitoring • Business intelligence
• Performance measurement
• Security attack detection
Message Control • Application of management policy
• Application of security policy
Message Transformation Data translation
Message Security Data confidentiality and integrity
Complex Event Processing • Simplification of software structure
• Ability to adapt quickly to different external environments
• Improved manageability and security
Implementing SOA: Example
The Corporate Network

Business
Enterprise Service Bus Process
Software Development Modeling
Workflow Presentation Service
Adapter Programming Tools
Engine App Servers SOA
In House Portal Services
DBMS Repository
apps Device Services
Modelling Tools
Messaging Services
SOA Testing Tools
Registry SOA App
Adapter
Testing
Packaged
Data Service
apps Service
Broker Data Federation SOA
ETL and Metadata
Data Archiving Governance
Adapter Infrastructure Service
Other SOA
Supervisor Message management
apps System management
Security management
Provisioning
Identity and Authentication
SOA Service Description

Directory

Service
Description

Service Service
Consumer Provider

Consumer queries the directory to


locate a service and communicate
with the provider
SOA Service Description

Directory

Service
Description

Service Service
Consumer Provider

Service Provider publishes


its service description and
directory
Web Service as Implementation of SOA

Implementation
Service Consumer Service Provider Web Service

Web Service is an
implementation of
SOA
SOA and Web Services
Topic 2—Web Services

• Why Use Web Services?


• What Are Web Services?
• Web Services Operational Model
• Web Services: Example
• Types of Web Services
Why Use Web Services?

1. Web applications enable interaction between an end user and a website. Web services are service-
oriented and enable application-to-application communication over the Internet and easy
accessibility to heterogeneous applications and devices.

2. Web services can be invoked through XML-based RPC mechanisms across firewalls.

3. Web services provide a cross-platform, cross-language solution based on XML messaging.

4. Web services facilitate ease of application integration using a lightweight infrastructure without
affecting scalability.

5. Web services enable interoperability among heterogeneous applications.


What Are Web Services?

• Web services are based on the concept of service-oriented architecture (SOA).

• According to Gartner research (June 15, 2001), “Web services are loosely coupled software
components delivered over Internet standard technologies.”

• Web services are self-describing and modular business applications that expose the business logic as
services over the Internet. This is done through programmable interfaces and Internet protocols to
provide ways to find, subscribe, and invoke those services.
Web Services Operational Model
Web Service operational model can be conceptualized as a simple operational model that has a lot in
common with a standard communication model:

Service
Broker

Service Service
Requestor Provider
Invoke Service

Operations are conceived as involving three distinct roles and relationships that define the Web
Services provider and users.
Web Services: Example

Consider the following scenario:

1. A Travel service provider deploys its Web services by exposing the business applications obtained from
different travel businesses like airlines, car-rental, hotel accommodation, credit card payment, and so forth.

2. The service provider registers its business services with descriptions using a public or private registry. The
registry stores the information about the services exposed by the service provider.

3. The customer discovers the Web services using a search engine or by locating it directly from the registry
and then invokes the Web services to perform travel reservations and other functions over the Internet
using any platform or device.

4. In the case of large-scale organizations, the business applications consume these Web services to provide
travel services to their own employees through the corporate intranet.
Web Services: Example

Travel Services Registry Airline


Wireless
Reservation
Device
System

Find Register
Services Services Rental car
Desktop Reservation
System
Invoke Services

Hotel
Service Requestor Travel Reservation Reservation
PDA
Services Provider System

Map and
Weather
Automobile Information
System

Credit card
Organization Payment
System
Types of Web Services

Web services are based on the following key standards:

1. Extensible Markup Language (XML) based messaging

2. Universal Description, Discovery, and Integration (UDDI)

3. Web Services Description Language (WSDL)

4. Simple Object Access Protocol (SOAP)


Types of Web Services
EXTENSIBLE MARKUP LANGUAGE (XML)

These technologies are interoperable at a core level as they use XML as data
Extensible representation layer for all web service protocols and technologies that are created
Markup
Language (XML) Process 1 Process 2
Universal
Description,
Discovery and
Integration
(UDDI)
XML Generator/ XML Generator/
Web Services Interpreter Interpreter
Description
Language (WSDL)
Simple Object
Access Protocol
(SOAP)
Communication Communication
Manager Manager
Types of Web Services
WEB SERVICES WITH XML

Extensible
Directory
Markup
Language (XML)
Service
Universal Description
Description,
Discovery and
Integration
(UDDI)
Web Services
Description XML
Service Service
Language (WSDL) Consumer Provider
Consumer formulates its message to
Simple Object the provider using tag-based
Access Protocol language called XML.
(SOAP)
Types of Web Services
UNIVERSAL DESCRIPTION, DISCOVERY AND INTEGRATION (UDDI)

UDDI provides a world-wide registry of web services for advertisements, discovery, and
Extensible integration purposes.
Markup
Language (XML) UDDI could be dynamic or static; Business Analysts and technologists could use UDDI to
search for available web services.
Universal
Description,
The UDDI Business Registry provides a place for a company to programmatically describe its
Discovery and
services and business processes and its preferred methods for conducting business.
Integration
(UDDI)
Web Services The directory is implicit
Web Services in web services
Description
Language (WSDL)
Simple Object
Access Protocol Any service producer
(SOAP) can also be a service
Service provider. So, the label Service
is changed to “Service”
Types of Web Services
WEB SERVICES DESCRIPTION LANGUAGE (WSDL)

Extensible WSDL describes the interface of the Web Service. It is comparable to the concept of “Remote
Markup Interface” of Java RMI or the “Interface Definition Language File (IDL)” of RPC.
Language (XML)
It standardizes how a web service represents the input and output parameters of an
Universal invocation externally, that is, the function structure, the nature of invocation (in, in/out,etc),
Description, and the service protocol binding.
Discovery and
Integration
(UDDI)
Web Services
Description
Language (WSDL)
Simple Object
Access Protocol
(SOAP)
Types of Web Services
WEB SERVICES WITH WSDL

Extensible
Markup WSDL Directory
Language (XML)
Universal Service
Description, Description
Discovery and
Integration Service description is written in a
(UDDI) special language called web service
Web Services description language (WSDL)
Description
Language (WSDL) Service Service
Simple Object Consumer Provider
Access Protocol
(SOAP)
Types of Web Services
USE OF WSDL

Extensible 2
Markup Directory
Directory
Language (XML)
Service queries
Query
Universal description response
Description, using WSDL
SOAP Messages using
Discovery and
1 WSDL
Integration
3
(UDDI)
4
Web Services XML service request based on WSDL
Description Service Service
Language (WSDL) Provider Consumer
Simple Object XML service response based on WSDL
Access Protocol
(SOAP) 5
Types of Web Services
SIMPLE OBJECT ACCESS PROTOCOL (SOAP)

Extensible SOAP is a simple XML-based protocol to let applications exchange information over HTTP.
Markup
Language (XML) It is a protocol for accessing a Web Service.

Universal
Description,
Discovery and
Integration
(UDDI)
Web Services
Description
Language (WSDL)
Simple Object
Access Protocol
(SOAP)
Types of Web Services
WHY USE SIMPLE OBJECT ACCESS PROTOCOL (SOAP)?

Extensible • It is important to have Internet communication between programs for application


Markup development.
Language (XML)
• Firewalls and proxy servers generally block traffic that creates a compatibility and security
Universal problem, even if they are used for application communication like RPC (Remote Procedure
Description, Call).
Discovery and
Integration • HTTP is supported by all Internet browsers and servers. However, SOAP was created to
(UDDI) accomplish better communication between applications.
Web Services
Description • SOAP supports different technologies and programming languages.
Language (WSDL)
Simple Object
Access Protocol
(SOAP)
Types of Web Services
SOAP ARCHITECTURE

SOAP envelope
Extensible
Markup
Language (XML) Header
Universal
Description,
Discovery and Body
Integration
(UDDI) WSDL
Web Services
Description XML or other format
Language (WSDL)
Simple Object
Access Protocol
(SOAP)
HTTP or other protocol
Types of Web Services
WEB SERVICES WITH SOAP

Extensible
Markup WSDL Directory
Language (XML)
Universal Service
Description, Description Messages are sent
Discovery and and received in a
Integration SOAP SOAP directory through
(UDDI) SOAP language
Web Services
Description
Language (WSDL) Service Service
Simple Object Consumer Provider
Access Protocol
(SOAP)
Types of Web Services
SOAP ELEMENTS

Extensible • Envelope: It identifies the XML document as a SOAP message.


Markup • Header: It is an optional element that contains header information.
Language (XML)
• Body: It contains call and response information.
Universal
Description, • Fault: It provides information about errors that occurred while processing the message.
Discovery and
Integration
(UDDI)
Web Services
Description
Language (WSDL)
Simple Object
Access Protocol
(SOAP)
Types of Web Services
SOAP ELEMENTS: ENVELOPE

Extensible • It is the root element of a SOAP message


Markup
Language (XML) • It defines the XML document as SOAP message

Universal
Description,
Discovery and
Integration
(UDDI)
Web Services
Description
Language (WSDL)
Simple Object
Access Protocol
(SOAP)

Envelope Header Body Fault


Types of Web Services
SOAP ELEMENTS: HEADER

Extensible • The optional SOAP Header element contains application-specific information (like
Markup authentication, payment, etc.) about the SOAP message.
Language (XML)
• If the Header element is present, it must be the first child element of the Envelope
Universal element.
Description,
Discovery and
Integration
(UDDI)
Web Services
Description
Language (WSDL)
Simple Object
Access Protocol All immediate child elements of the Header element must be namespace-
(SOAP) qualified.

Envelope Header Body Fault


Types of Web Services
SOAP ELEMENTS: BODY

Extensible • The required SOAP Body element contains the actual SOAP message intended for the
Markup ultimate endpoint of the message.
Language (XML)
• Immediate child elements of the SOAP Body element may be namespace-qualified.
Universal
Description, • This is the SOAP Fault element used to indicate error messages.
Discovery and
Integration
(UDDI)
Web Services
Description
Language (WSDL)
Simple Object
Access Protocol
(SOAP)

Envelope Header Body Fault


Types of Web Services
SOAP ELEMENTS: FAULT

• The optional SOAP Fault element is used to indicate error messages.


Extensible
Markup • The SOAP Fault element holds errors and status information for a SOAP message.
Language (XML)
Universal • If a Fault element is present, it must appear as a child element of the Body element. A Fault
Description, element can only appear once in a SOAP message.
Discovery and
Integration • The SOAP Fault element has the following sub elements:
(UDDI)
Web Services Sub Element Description
Description <faultcode> A code for identifying the fault
Language (WSDL)
<faultstring> A human readable explanation of the fault
Simple Object
Access Protocol <faultactor> Information about who caused the fault to happen
(SOAP) <detail> Holds application specific error information related to the Body element

Envelope Header Body Fault


SOA and Web Services
DEMO—SOAP Application
Java APIs for Web Service

There are two main APIs defined by Java for developing web service applications (since Java EE 6):

1. JAX-WS: for SOAP web services.


2. JAX-RS: for RESTful web services.
SOA and Web Services
Topic 3—Creating a SOAP based Web Service

• Axis
• Web Service in an Axis Environment
• Creating a SOAP based Web Service
Axis

Axis facilitates easy deployment and undeployment of services using XML-based Web services deployment
descriptors (WSDDs).

• It enables deploying and undeploying services and also Axis-specific resources like handlers and chains
using an administration utility ‘AdminClient’ provided as part of the Axis toolkit.

• It helps deploy a service, ensures that the AXIS CLASSPATH is set, and runs the following command:

java org.apache.axis.client.AdminClient deploy.wsdd

• It helps undeploy a service, ensures that the AXIS CLASSPATH is set, and then runs the following command:

java org.apache.axis.client.AdminClient undeploy.wsdd


Web Service in an Axis Environment

To create a Web service in an Axis environment, the following Models are used:

1. Create the service provider (server application)

2. Create the service requester (client applications)


Creating a SOAP based Web Service

1. Create a new dynamic web project and name it “SimpleSOAPExample”

2. Create a new package named “com.webservice”

3. Create a simple Java class named “HelloWorld.java” which works as Service

4. Right click project  new  web service

5. Click next

In service implementation text box, write the qualified class name of created class (HelloWorld.java),
move both above slider to maximum level (Test service and Test Client level), and click finish. You are
done. A new project named “SimpleSOAPExampleClient” will be created in your work space.

6. Click start server

7. After clicking start server, eclipse will open test web service API. With this test API, you can test your
web service
Creating a SOAP based Web Service
STEP 1: Create a new dynamic web project and name it “SimpleSOAPExample”
Create a new dynamic
web project and name
it
“SimpleSOAPExample”’

Create a new package


named
“com.webservice”

Create a simple Java


class named
“HelloWorld.java”

Right click project 


new  web service

Click next

Click start server

Test your Web service


Creating a SOAP based Web Service
STEP 2: Create a new package named “com.webservice”
Create a new dynamic
web project and name
it
“SimpleSOAPExample”’

Create a new package


named
“com.webservice”

Create a simple Java


class named
“HelloWorld.java”

Right click project 


new  web service

Click next

Click start server

Test your Web service


Creating a SOAP based Web Service
STEP 3: Create a simple Java class named “HelloWorld.java”
Create a new dynamic
web project and name
it The following example is of a simple service that accepts a string parameter, invokes a
“SimpleSOAPExample”’ method justSayHello, and returns a String parameter:
Create a new package
named
“com.webservice” package com.weservice;
Create a simple Java
public class HelloWorld {
class named
“HelloWorld.java”
public String sayHelloWorld(String name)
Right click project  {
new  web service return "Hello world from "+ name;
}
}
Click next

Click start server

Test your Web service


Creating a SOAP based Web Service
STEP 4: Right click project  new  web service
Create a new dynamic
web project and name
it
“SimpleSOAPExample”’

Create a new package


named
“com.webservice”

Create a simple Java


class named
“HelloWorld.java”

Right click project 


new  web service

Click next

Click start server

Test your Web service


Creating a SOAP based Web Service
STEP 5: CLICK NEXT
Create a new dynamic
web project and name
it
“SimpleSOAPExample”’

Create a new package


named
“com.webservice”

Create a simple Java


class named
“HelloWorld.java”

Right click project 


new  web service

Click next

Click start server

Test your Web service


Creating a SOAP based Web Service
STEP 6: CLICK START SERVER
Create a new dynamic
web project and name
it
“SimpleSOAPExample”’

Create a new package


named
“com.webservice”

Create a simple Java


class named After you click start
“HelloWorld.java”
server, you will be re-
directed to this page.
Right click project 
Click Finish.
new  web service

Click next

Click start server

Test your Web service


Creating a SOAP based Web Service
STEP 7: TEST YOUR WEB SERVICE
Create a new dynamic
web project and name
it
“SimpleSOAPExample”’

Create a new package


named
“com.webservice”

Create a simple Java


class named
“HelloWorld.java”

Right click project 


new  web service

Click next

Click start server

Test your Web service


SOA and Web Services
Topic 4—Creating a RESTful Web Service

• Introduction to RESTful Web Services


• RESTful Web Services: Working
• Creating a RESTful Web Service
• SOAP vs. RESTful Web Services
Introduction to RESTful Web Services

RESTful web services are lightweight, highly scalable, and maintainable Web Services. They are basically
based on REST (Representational State Transfer) Architecture.

REST architecture is basically focuses on two things:

1. Resources: Its application functionality, which is represented by a unique URL.


2. Interface: Its HTTP method works as an interface to access the resources.
RESTful Web Services: Working

• A RESTful web service usually defines a URI (Uniform Resource Identifier), which is a service that provides
resource representation such as JSON and a set of HTTP Methods.

• There is no need to use XML data interchange format for request and response.

• The REST web services can be return XML, JSON, or even HTML format response.

Smartphone
Creating a RESTful Web Service
FUNCTIONALITIES

Create a web service called UserLog Management with the following functionalities:

HTTP Method URI Operation Operation Type

GET /UserLogService/users Get list of users Read Only

GET /UserLogService/users/1 Get User with Id 1 Read Only

PUT /UserLogService/users/2 Insert User with Id 2 Idempotent

POST /UserLogService/users/2 Update User with Id 2 N/A

DELETE /UserLogService/users/1 Delete User with Id 1 Idempotent

List the supported


OPTIONS /UserLogService/users Read Only
operations in web service
Creating a RESTful Web Service
ENVIRONMENT SETUP

1. Set up Java Development Kit (JDK)

2. Set up Eclipse IDE

3. Set up Jersey Framework Libraries

4. Download the latest version of Jersey framework binaries from the following link:
https://jersey.java.net/download.html

5. Set up Apache Tomcat


Creating a RESTful Web Service
WRITING RESTful WEB SERVICE WITH JERSEY FRAMEWORK

1. Create a Dynamic Web Project named UserLogManagement using Eclipse IDE.

2. Add Jersey Framework and its dependencies (libraries) in your project.

3. Create UserLogService.java and User.java,UserLogDao.java files under your dynamic project

4. Create a Web XML Configuration file to specify Jersey framework servlet for your application.

5. Export your application as a war file and deploy the same in tomcat.
Creating a RESTful Web Service
Writing User.Java class

Class User has id, name, and designation member variable, and it uses @XmlRootElement and
@XmlElement annotations.

//When a top level class is annotated with the @XmlRootElement annotation,


then its value is //represented as XML element in an XML document.
@XmlRootElement(name = "user")
public class User implements Serializable {
private static final long serialVersionUID = 1L;
private int id;
private String name;
private String profession;
@XmlElement //Maps a JavaBean property to a XML element derived from
property name.
//setter methods
//getter methods
//constructor
}
Creating a RESTful Web Service
Writing UserLogDAO Class

It uses two methods to get user details. First, it checks for the file name User.dat. It it does not exist, it
adds one user data to UserList. It then opens User's file and reads data.

public List<User> getAllUsers(){


List<User> userList = null;
File file = new File("Users.dat"); private void saveUserList(List<User>
if (!file.exists()) { userList){
User user = new User(1, "John", "Worton"); try {
userList = new ArrayList<User>(); File file = new
userList.add(user); File("Users.dat");
saveUserList(userList); FileOutputStream fos;
else{ fos = new
FileInputStream fis = new FileOutputStream(file);
FileInputStream(file); ObjectOutputStream oos = new
ObjectInputStream ois = new ObjectOutputStream(fos);
ObjectInputStream(fis); oos.writeObject(userList);
userList = (List<User>) ois.readObject(); oos.close();
ois.close(); }
return userList;
}
Creating a RESTful Web Service
Writing UserLogservice Class

Path("/UserLogService") //Identifies the URI path that a resource class or class


method will serve //requests for.

public class UserLogService {


UserDao userDao = new UserDao();
@HttpMethod(value="GET") // Indicates that the annotated method responds to
HTTP GET requests
@Path("/users")
@Produces(MediaType.APPLICATION_XML) // is used to specify the MIME
(Multipurpose //Internet Mail Extensions)media types or representations a
resource can produce and send back to the //client.
public List<User> getUsers(){
return userDao.getAllUsers();
}
}
Creating a RESTful Web Service
Writing web.xml File

web-app>
<servlet>
<servlet-name>Jersey RESTful Application</servlet-name>
<servlet-
class>org.glassfish.jersey.servlet.ServletContainer</servletclass>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.tutorialspoint</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>Jersey RESTful Application</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
</web-app>

URL to run the program:


http://localhost:8080/UserLogManagement/rest/UserLogService/users
SOAP vs. RESTful Web Services

SOAP RESTful
The main advantage of SOAP is that it provides a
In RESTful Web Services, clients have to know what to
mechanism for services to describe themselves to
send and what to expect.
clients and to advertise their existence.
SOAP brings its own protocol and focuses on
REST is focused on accessing named resources
exposing pieces of application logic (not data) as
through a single consistent interface.
services.
REST has better performance and scalability. REST
SOAP-based reads cannot be cached.
reads can be cached,

SOAP only permits XML. REST permits many different data formats
SOA and Web Services
DEMO—RESTful Web Services
Key Takeaways

Software evolution begins with understanding the concept of 1 and 0 (i.e.,bits)


that gives rise to machine language, followed by assembly language, procedure
oriented, object oriented, component oriented, and service oriented.

Service Oriented approach follows an architecture, called SOA (Service Oriented


Architecture), that focuses on building systems through the use of different Web
Services and integrating them to make up the whole system.

Web applications enable interaction between an end user and a website. Web
services are service-oriented and enable application-to-application
communication over the Internet and easy accessibility to heterogeneous
applications and devices.

RESTful web services are lightweight, highly scalable, and maintainable Web
Services. They are basically based on REST (Representational State Transfer)
Architecture.
Quiz
QUIZ
UDDI stands for
1

a. Universal Description Discovery and Integration

b. Unified Description Directory and Integration

c. Uniform Data Dictionary and Identification

d. Uniform Data Dictionary and Integration


QUIZ
UDDI stands for
1

a. Universal Description Discovery and Integration

b. Unified Description Directory and Integration

c. Uniform Data Dictionary and Identification

d. Uniform Data Dictionary and Integration

The correct answer is a.


UDDI stands for Universal Description Discovery and Integration
QUIZ
Which of the following is correct about WSDL?
2

a. WSDL is the standard format for describing a web service.

b. WSDL definition describes how a web service can be accessed and what operations it
can perform

c. WSDL is a language for describing how to interface with XML-based services

d. All of the above


QUIZ
Which of the following is correct about WSDL?
2

a. WSDL is the standard format for describing a web service.

b. WSDL definition describes how a web service can be accessed and what operations it
can perform

c. WSDL is a language for describing how to interface with XML-based services

d. All of the above

The correct answer is d. All of the above


WSDL is the standard format for describing a web service. WSDL definition describes how a web
service can be accessed and what operations it can perform. WSDL is a language for describing how
to interface with XML-based services
Thank You

You might also like