introduction to web services geoff williams british oceanographic data centre joseph proudman...

20
Introduction to Web Introduction to Web Services Services Geoff Williams British Oceanographic Data Centre Joseph Proudman Building 6 Brownlow Street Liverpool L3 5DA, UK

Upload: clement-marshall

Post on 23-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Introduction to Web ServicesIntroduction to Web Services

Geoff Williams

British Oceanographic Data Centre

Joseph Proudman Building6 Brownlow Street

Liverpool L3 5DA, UK

Prerequisite knowledgePrerequisite knowledge

Client-server computing

• Server provides a service (i.e., www, email, etc.)

• Client uses the service

• A client can use many services

• A server can provide a service to many clients

• A single computer may fulfil more than one role

WWW Client WWW server

WWW Server DatabaseServer

Client(user)

WWW server

DatabaseClient

What is a Web service?What is a Web service?

W3C Definition• “A software system designed to support interoperable

machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with XML serialization in conjunction with other Web-related standards.”

(W3C, 2004)

What is a Web service?What is a Web service?

Another definition

• “Web services are a distributed computing architecture. Only this particular architecture makes use of loosely coupled applications, as opposed to tightly coupled applications, to enable applications to communicate. This tightly coupled concept radically affects how information systems will work in the future”

(Clabby 2003)

My own observationsMy own observations

• Web services provide a convenient and standardised way of exposing business logic over a network (the Internet)

• Convenient: WS frameworks (i.e., AXIS) do the hard work for us

• Standardised: SOAP (XML) provides a language to speak to clients

• BODC expose controlled vocabularies via Web services

• The interface to this business logic (data in/data out/operations) is formally documented in the service WSDL

• Client code is normally generated automatically from the WSDL, so programmers do not need to worry about writing it

• Programs that use Web services work by sending a request to a Web service and using the result somehow, i.e., displaying it or using it to perform a calculation

Real-world Web servicesReal-world Web services

BODC ControlledVocabularies

Web service

Note: The user is not directly using the Web service.

ProgramInternet

Users

The Web service encapsulates and controls access to the Controlled vocabularies. This design is known as a “wrapper”

What are Web services aren’tWhat are Web services aren’t

• Not a human-readable web page

• Not necessarily available over the Internet

• Not a fundamentally new business concept

• Not independent of web applications

• Not solely externally focussed

• Not a way of making your application more robust, secure and available

• Not a user-centric self-contained application

(Claßen 2002)

How do I use a Web service?How do I use a Web service?

1. Find the web service you want to use

2. Tell the application you are writing where to get the service WSDL

3. Generate the client code (often done automatically)

4. Your application sends a request to the service

5. Your application receives and processes the result

This is best explained with a diagram…

How do I use a Web serviceHow do I use a Web service

UDDI(?)

Web service

Writes

Uses

UsesChoose Web service

SOAP messages

Generate WS client&

Compile/ExecuteWSDL

Program

InternetCode

How can Web services benefit my How can Web services benefit my organisation?organisation?

• Developers can focus on writing applications instead of worrying about infrastructure

• Reduced application development time and expense

• A portfolio of Web services may be built

• New collaboration opportunities

• Repackage existing products to better reach/serve user base

(Clabby 2003)

Key technologiesKey technologies

XML (eXtensible Markup Language)

• A language for describing new languages (metalanguage)

• Platform independent

• Defined with Unicode allowing representation of many languages

• XML concepts

• Elements• Attributes• Comments• Literal text• Document• DTD/Schema

(Weerawarana et al 2005)

Key technologiesKey technologies

UDDI (Universal Description, Discovery and Integration)• An XML dialect• Provides a single well-known place to search for services

(Weerawarana et al 2005)• A “registry standard” that allows applications to describe

themselves to other applications (Clabby 2003)• Ability to dynamically select a service at runtime• Public registries don’t provide the level of trust that is

required to allow a service requestor to select and use any service provider listed in the registry (Graham 2005)

• Most interest in UDDI focuses on private registries hosted on the Internet or an intranet, usually for a specific purpose (Graham 2005)

Key technologiesKey technologies

WSDL (Web Services Description Language)

• An XML dialect

• Describes how to communicate with a Web service

• What a service does

• Operations• Data (in and out)

• How service accessed

• Data formats• Protocols

• Where located

• Network address (URL)• The location is known as a “service endpoint”

(Graham et al. 2005)

Key technologiesKey technologies

SOAP (Simple Object Access Protocol)• An XML dialect

• Messaging framework providing resilience, scalability and flexibility

• Standardized message structure based on XML• Processing model describing how to process messages• Mechanism to bind SOAP messages to different network

protocols• Attach non-XML encoded information to SOAP requests(Weerawarana 2005)

• All data needs to be converted into SOAP format prior to transmission. This is known as serialisation.

• All data received in SOAP format needs to be converted back to its original form. This is known as deserialisation.

Key technologiesKey technologies

HTTP (Hyper Text Transfer Protocol)• Protocol for transferring data across the Internet

• Main use is for delivering web pages and associated content

• Web services generally use HTTP to transfer data

• Ubiquitous support• Passes through corporate firewalls unchallenged

(usually)

Key technologiesKey technologies

Web services framework• Provides an easy and reusable way to use WSDLs, SOAP

and UDDI

• Programmer only needs to learn how to program to the frameworks’ interface and does not need to worry about manually building SOAP messages, etc.

• Popular frameworks:

• Axis (Java) http://ws.apache.org/axis/• Axis2 (Java) http://ws.apache.org/axis2/• SOAP module (PHP4) http://pear.php.net/package/SOAP • SOAP extensions (PHP5) compile time option• SOAP::Lite (Perl) http://www.soaplite.com/• SOAPy (Python) http://soapy.sourceforge.net/• C#/VB/ (Windows) Support via visual studio• …And many more!

• Most text books present UDDI as a the web service equivalent to an Internet search engine where business services can be selected automatically, however:• Computer programs autonomously selecting

strategic business partners is not desirable• Far from being a panacea, public UDDI directory

support is immature and may never mature• A UDDI directory may disappear altogether

(BindingPoint), potentially breaking your application• However, a specialist UDDI registry may be of interest

to the oceanographic community

UDDI – Pinch of salt requiredUDDI – Pinch of salt required

How it all fits togetherHow it all fits together

XML

HTTP

Network stack (TCP/IP)

Network stack (TCP/IP)

HTTP

XML

SOAP WSDL

Data Application software

Internet

UDDI(?)

SOAP WSDLUDDI(?)

Client

ServerM

edia

Data Application software

•Each layer ‘wraps’ the functionality of the previous one adding features and improving reliability•The client software stack is the mirror image of the server’s stack (generally)•UDDI is optional but included for completeness•The client doesn’t generate a WSDL, it just obtains one from the server

Web services framework

Web services framework

Thanks for listeningThanks for listening

Any questions?

ReferencesReferences

• Booth, D. et al. (2004) Web Services Architecture [Internet], February. Available from: <http://www.w3.org/TR/ws-arch/> [Accessed 5 February 2007].

• Claßen, M. (2002) What Web Services Are Not [Internet], Jupitermedia Corp. Available from: <http://www.webreference.com/xml/column50/> [Accessed 5 February 2007]

• Clabby, J. (2003) Web Services Explained. New Jersey USA, Prentice Hall PTR.

• Weerawarana, S. et al (2005) Web Services Platform Architecture: SOAP, WSDL, WS-POLICY WS-Addressing, WS-BPEL, WS-Reliable Messaging, and More. New Jersey USA, Prentice Hall PTR.

• Graham, S. et al (2005) Building Web Services With Java: Making Sense Of XML, SOAP, WSDL, AND UDDI