[API Word 2021] - Quantum Duality of “API as a Business and a Technology”
WSO2 ESB Integration with REST
1. WSO2 ESB Integration with REST
Dushan Abeyruwan
Associate Tech Lead, Integration Tech Group
Ravi Undupitiya
Software Engineer, Integration Tech Group
2. About WSO2
• Providing the only complete open source componentized cloud
platform
– Dedicated to removing all the stumbling blocks to enterprise agility
– Enabling you to focus on business logic and business value
• Recognized by leading analyst firms as visionaries and leaders
– Gartner cites WSO2 as visionaries in all 3 categories of application
infrastructure
– Forrester places WSO2 in top 2 for API Management
• Global corporation with offices in USA, UK & Sri Lanka
– 200+ employees and growing
• Business model of selling comprehensive support &
maintenance for our products
4. Background
• Service
Oriented
Architecture
(SOA)
– A
style
of
so:ware
architecture
that
is
modular,
distributed
and
loosely
coupled.
– ComponenBzaBon
–
The
main
driver
of
SOA
– Business
FuncBonaliBes
are
implemented
in
different
Business
Components
– Business
Components
provide
their
funcBonality
to
its
consumers
as
a
‘Service’
with
the
well-‐defined
service
interfaces.
5. Background
• Enterprise
Service
Bus
(ESB)
– An
ESB
is
a
middleware
soluBon
that
enables
interoperability
among
heterogeneous
environments
using
a
service-‐oriented
model.
– Stateless
and
Seamless
IntegraBon
– Standard
Protocols
–
SOAP,
REST,
JSON
etc.
– Transports
–
HTTP/S,
JMS,
TCP,
VFS
etc.
Source : http://graegert.com/programming/no-soa-criticism-somewhere
6. Under
the
Hood:
Apache
Synapse
• A
lightweight,
open
source
ESB
implementaBon
from
the
ASF
:
hXp://synapse.apache.org
• Makes
up
the
mediaBon
engine
of
WSO2
ESB
• MulBthreaded
and
asynchronous
message
processing
core
• Based
on
a
number
of
well
known
open
source
projects
(eg:
Axis2,
HXp
Core)
7.
•
REpresentaBonal
State
Transfer
•
An
architectural
Style
–
Not
a
Standard
•
RESTful
applicaBons
use
HTTP
requests
to
• post
data
(create
and/or
update)
• read
data
(e.g.,
make
queries)
• Delete
data.
•
REST
uses
HTTP
for
CRUD
(Create/Read/Update/Delete)
operaBons.
Eg:
TwiXer
REST
API
•
hXps://dev.twiXer.com/docs/api/1.1
What
is
REST?
10. Moral
of
the
Story…
•
Replacing
exisBng
technologies
is
not
easy
•
Every
technology
has
its
own
strengths
and
weaknesses
– Despite
its
arcane
terminology,
the
structured
descripBon
capabiliBes
of
the
WSDL
standard
is
being
praised
even
by
hard-‐core
fans
of
REST
– No
technology
can
be
designated
“universally
superior”
11. REST API
• Exposing
RESTful
APIs
• A
easy
way
to
expose
exisBng
SOAP
services
over
REST
• REST
à
SOAP
conversion
• Mainly
used
in
WSO2
API
Manager
14. REST APIs
l An API is similar to a web application hosted on the
ESB
l Anchored at a specific URL path (context)
l /test
l /dictionary
l /foo/bar
l Can be bound to a specific host and a port
l Contains one or more resources
15. Resources
l A RESTful resource exposed over HTTP
l Similar to a proxy service but focuses on REST
l Can be associated with
l A set of HTTP methods
- GET only, GET and POST only, All HTTP
methods
l A specific content type
- application/xml, application/json
l A particular class of clients (user agents)
16. Dispatching Requests to a Resource
l URL patterns
l Reg-Ex match
l /test/*
l Extension match
l *.jsp
l Exact match
l /test/index.jsp
l URI templates
l /dictionary/{character}/{word}
l /accounts/{accountId}/{operation}
l HTTP Verbs (GET/PUT/POST/OPTIONS)
29. HTTP Endpoint
• New in WSO2ESB 4.7.0
• Enhances RESTful support. Can be used with SOAP WS.
• Support for HTTP verbs and URI-Template variables
• An example:
• Exposing Twitter Search API
30. OAuth: REST security done right
• Adheres to statelessness in REST architecture.
31. API Management Goals
l Service
provider
objecBves
l Define
APIs
l Define
security
requirements
and
SLAs
l Monitor
API
usage
and
SLAs
l Service
consumer
objecBves
l Discover
and
browse
APIs
l Sign
up
and
obtain
API
keys
l Consume
APIs
using
the
obtained
keys
l Monitor
API
usage
and
SLAs
32. Engage with WSO2
• Helping you get the most out of your deployments
• From project evaluation and inception to development
and going into production, WSO2 is your partner in
ensuring 100% project success