Web Services
Download
Report
Transcript Web Services
Enabling Grids for E-sciencE
Web Services
Mike Mineter
National e-Science Centre, Edinburgh
www.eu-egee.org
INFSO-RI-508833
Goal of presentation
Enabling Grids for E-sciencE
• An orientation to Web Services
• No prior knowledge assumed
INFSO-RI-508833
Web Services
3
Outline
Enabling Grids for E-sciencE
• Web Service (WS) concepts
• WS standards and consequences
• Creating a WS using Java
• Practical
• Next talk: WS and Grids
INFSO-RI-508833
Web Services
4
What are “Web Services?”
Enabling Grids for E-sciencE
•
History
1. Web browsing
2. Web pages with content from applications
3. Applications that are useable by software clients
•
Web Services are software components that are..
–
–
Accessible across a network
Loosely coupled
–
•
Defined by the messages they receive / send
Modular and self-contained
So can change service implementation without changing interfaces
Interoperable: each service has a description that is accessible and
can be used to create software to invoke that service
… and based on standards
–
–
–
Usually built on (extensions of) standards made ubiquitous by the
Web: http(s), XML, … and for which tools are already built.
Developed in anticipation of new uses – e.g. can compose workflow
Encouraging adoption and new tools
INFSO-RI-508833
Web Services
5
Enabling Grids for E-sciencE
• Accessible across a
network
• Loosely coupled, defined
by the messages they
receive / send
• Interoperable: each
service has a description
that is accessible and can
be used to create
software to invoke that
service
• Based on standards (for
which tools do / could
exist)
• Developed in anticipation
of new uses
INFSO-RI-508833
Service orientation – software
components that are…
Client
Registry
Service
Service
Service
Service
Service
Service
Web Services
6
Web Services
Enabling Grids for E-sciencE
Registry
Discovery
Registration
Invocation
Client
INFSO-RI-508833
Service
Web Services
7
Composition in workflow
Enabling Grids for E-sciencE
Client
Registry
Registry
Service
Service
Service
Service
Service
A
Service
INFSO-RI-508833
Service
B
Service
Web Services
8
Using service B from service A
Enabling Grids for E-sciencE
service B
service A:
consumes B
Messages
Web services
container
O/S
A
INFSO-RI-508833
Web services
container
TCP/IP
messages
O/S
B
Web Services
9
Using service B from service A
Enabling Grids for E-sciencE
These messages define service B
service B
service A:
consumes B
Messages
Web services
container
O/S
A
INFSO-RI-508833
Web services
container
TCP/IP
messages
O/S
B
Web Services
10
HTTP and HTTPS
Enabling Grids for E-sciencE
• Commonly used for WS - original
purpose: carry HTML
• HTTP request methods
•GET : specify a URL
•POST:
pairs
service key-value
A:
• Defaults
to B
port 80
client for
• HTTPS: encrypts / decrypts
service B
Messages
Web services
container
Web services
container
http, https
O/S
A
INFSO-RI-508833
TCP/IP
messages
O/S
B
Web Services
11
XML – usual basis for messages
Enabling Grids for E-sciencE
XML
eXtendable Markup Language
•Human readable (sort of) – so not
tied to one architecture
service A: can define new data
• Extendable:
clientbelong
for B to “namespaces”,
types,
expressed by schemas
service B
Messages
Web services
container
XML
Web services
container
http, https
O/S
A
INFSO-RI-508833
TCP/IP
messages
O/S
B
Web Services
12
WSDL -1
Enabling Grids for E-sciencE
service A:
consumes B
Service B is described by WSDL,
“Web Service Description
Language”. Includes:
•Where: “ end point” URL where B
receives messages
service B
•What: Message definitions
•How: “Bindings” to use service
Messages
Web services
container
XML
Web services
container
http, https
O/S
A
INFSO-RI-508833
TCP/IP
messages
O/S
B
Web Services
13
WSDL -2
Enabling Grids for E-sciencE
•API’s are derived from the WSDL by
tools
•Developer adds code for specific
client
service B
service A: •NO API LIBRARY SUPPLIED
consumes B
API’s for
B
Messages
Web services
container
XML
Web services
container
http, https
O/S
A
INFSO-RI-508833
TCP/IP
messages
O/S
B
Web Services
14
SOAP
Enabling Grids for E-sciencE
Commonly used XML-based messaging
protocol
Header: extendable for security,accounting,
Body: message content
service B
service A:
consumes B
API’s for
B
Messages
Web services
container
SOAP
Web services
container
http, https
O/S
A
INFSO-RI-508833
TCP/IP
messages
O/S
B
Web Services
15
WS-I core of Web Services
Enabling Grids for E-sciencE
• WS-I (Interoperability) delivers practical guidance, best practices
and resources for developing interoperable Web services
solutions.
• http://www.ws-i.org/
Open standards:
• SOAP: protocol for message passing
• Web Service Description Language: to describe services
• UDDI: Universal Description, Discovery and Integration
• WS-Security: incorporates security
INFSO-RI-508833
Web Services
17
Apache Software Foundation
Enabling Grids for E-sciencE
• WS standards and consequences
– Standards justify investment in tools
– Feedback into easier development of services and clients
• The Apache Software Foundation (ASF) is a non-profit
organization
– http://www.apache.org/foundation/how-it-works.html
• We will be using:
– Apache Tomcat : servlet container
– Apache Axis: implements SOAP
INFSO-RI-508833
Web Services
18
(JAVA) Web Services
Enabling Grids for E-sciencE
Insert the internet into the
invoke
and into the return
A
B
invoke
B.Op
(a,b)
return
c
Java
program
with 2
classes
INFSO-RI-508833
A
Bstub Stack
invoke
Bs.Op
(a,b)
return
c
…
Op(a,b)
SOAP
Soap
envelope
envelope
HTTP
message
Sk
Stack eleton
…
Web
…
Ret(c)
SOAP
envelope
…
B
invoke
B.Op
(a,b)
return
c
HTTP
message
Consumes B
(client)
Provides B
(server)
Web Services
19
Building (JAVA) Web Services
Enabling Grids for E-sciencE
WSDL for B
Java WS tools
Insert the internet into the
invoke
and into the return
A
B
invoke
B.Op
(a,b)
return
c
Java
program
with 2
classes
INFSO-RI-508833
A
Bstub Stack
invoke
Bs.Op
(a,b)
return
c
…
Op(a,b)
Soap
Soap
envelope
envelope
HTTP
message
Sk
Stack eleton
…
Web
…
Ret(c)
Soap
envelope
…
B
invoke
B.Op
(a,b)
return
c
HTTP
message
Consumes B
(client)
Provides B
(server)
Web Services
20
Scope of most WS use at present
Enabling Grids for E-sciencE
• Intranet: within secure closed environment
– Behind firewall
– Benefits of Service Orientation within an enterprise
• Services in the public domain – google, amazon,….
• To extend use:
– Need to add authorisation and authentication
Including in workflow
– WS-Security standard is a response
INFSO-RI-508833
Web Services
21
Further reading
Enabling Grids for E-sciencE
• The Apache Software Foundation (ASF)
http://www.apache.org/
• WS-I
• http://java.sun.com/xml/webservices.pdf
INFSO-RI-508833
Web Services
22
Summary
Enabling Grids for E-sciencE
• Service Oriented Architectures
• Web services
• Impact of having standards
– Stimulating confidence, uptake and tool creation
• Note also: Higher languages definable – based on XML
– SOAP for message exchange and WS invocation
– Application specific
GML for geographical data
…….
INFSO-RI-508833
Web Services
23