understanding web services
TRANSCRIPT
Impact of internet growing 3
The rising of Service-Oriented-Architecture (SOA)
• Reusability• Integration • Interoperability
Initial approach 4
Application
Client RPC
RPC library
Transport
Application
Server RPC
RPC library
Transport
RPC = Remote Procedure Call
History 5
• RPC (Remote Procedure Call) solutions•RMI
•Remote Method Invocation •CORBA
•Common Object Request Broker Architecture•And others
•Sun RPC, DCOM…
“A Web Service is a piece of business logic, located somewhere on the internet, that is accessible through standard-based Internet protocols, such as HTTP or SMTP. Using a web service could be as simple as logging into a site or as complex as facilitating a multi-organization business negotiation.”
(David Chappel, Java Web Services).
10
Characteristics 11
•XML-based •Loosely coupled •Coarse-grained •Ability to be synchronous or asynchronous •Supports Remote Procedure Calls (RPCs)
Major Web Services Technologies 12
•Simple Object Access Protocol (SOAP)
Soap Envelope
Header
Body
SOP Envelope
Web Services and SOA Architecture 16
Registry
(
Service Provider
"
Service Consumer
"
1. Pu
blish
WSD
L
2. Query services3. Response WSDL
4. XML service request
5. XML service response
The Principles 20
• Uniform Interface using using Uniform Resource Identifiers (URIs)
• Client-Server • Stateless •Cacheable •Layered System
When Use REST over SOAP 21
• REST is not protocol, rather a way of doing Web calls over HTTP using XML or JSON
• Easy to use as it's a simple HTTP protocol with JSON or XML
•Great for using with Javascript, AJAX, and jQuery.
•Usually REST offers rapid operating speed without the need of extensive processing.
• No standard authentication protocol. • No standard data definition language.
REST Basics 25
• Design your Web Services operations combining resources and verbs
Operations Definition
List Tickets GET /myapp/tickets
Get Single Ticket GET /myapp/tickets/<id>
Create Ticket POST /myapp/tickets
Update Existing Ticket PUT /myapp/tickets/<id>
Delete Existing Ticket DELETE /myapp/tickets/<id>
Practice: RESTful WEB Service 27
• Sample Project using Spring Boot •Testing using Postman
github.com/fabricioepa/lab-springboot-rest-sample
!
"
#
$
%&
$./run
{
Created by Fabrício Epaminondas ©2015-2020
FABRICIO EPAMINONDAS + linkedin.com/in/fabricioepa
, fabricioepa.wordpress.com
- fabricioepa
. @fabricioepa
'Contact