18 copyright © 2005, oracle. all rights reserved. distributing modular applications: introduction...

28
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

Upload: amber-warner

Post on 27-Mar-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18Copyright © 2005, Oracle. All rights reserved.

Distributing Modular Applications: Introduction to Web Services

Page 2: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-2 Copyright © 2005, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to do the following:

• Describe the Web services technology

• Identify the standards used by Web services

• Identify the benefits of Web services

• Distinguish between remote procedure call (RPC)-style and document-style Web services

• Discuss the role of Simple Object Access Protocol (SOAP), Web Services Description Language (WSDL), and Universal Description, Discovery, and Integration (UDDI) in Web services

Page 3: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-3 Copyright © 2005, Oracle. All rights reserved.

What Is a Web Service?

External applications

HTML

XML

Webpresentation

Businesslogic

Webservice

Databases

Application Server

HTTP client

Page 4: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-4 Copyright © 2005, Oracle. All rights reserved.

Web Service

A Web service is:

• A software component whose technology is based on a set of standards for building interoperable distributed applications

• A set of self-describing business functions

• Service oriented

• Component based

Page 5: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-6 Copyright © 2005, Oracle. All rights reserved.

Service-Oriented Architecture

Invoke

Servicerequestor

Publish Find

Service provider

Serviceregistry

Page 6: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-7 Copyright © 2005, Oracle. All rights reserved.

Web Services Constituents

• Internet for communication

• XML as universal data format

• SOAP for XML messaging

• WSDL for describing the service

• UDDI for publishing the Web services

Page 7: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-9 Copyright © 2005, Oracle. All rights reserved.

Benefits of Web Services

• Distributed component model with interoperability

• XML format for representing data. The request and response messages are in the XML format.

• Programming language independent

• Easily accessible with standard protocols such as HTTP, HTTPS, SMTP, and FTP

• Communication through firewalls

• Existing components can be exposed as Web services to save development time.

• Different communication styles:– RPC style (synchronous)

– Message style (asynchronous)

Page 8: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-11 Copyright © 2005, Oracle. All rights reserved.

Web Services Model

Web servicesdirectory

(UDDI)

XML interface (WSDL)

Web service

Find

Invoke Publish

1

2

3

XML interface (WSDL)

Client application

Page 9: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-12 Copyright © 2005, Oracle. All rights reserved.

RPC-Style Web Services

• RPC-style Web services are loosely coupled.

• SOAP messages model the call and response semantics.

• This style of communication can be described in WSDL.

Page 10: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-13 Copyright © 2005, Oracle. All rights reserved.

Document-Style Web Services

• Document-style Web services are loosely coupled.

• SOAP messages carry arbitrary XML documents.

• This style of communication can be described in WSDL.

Page 11: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-14 Copyright © 2005, Oracle. All rights reserved.

Oracle Support for Web Services

Oracle Application Server 10g is the infrastructure for:• Describing Web

services• Deploying Web

services• Publishing Web

services• Invoking Web

services

Oracle JDeveloper 10gprovides tools for:• Developing, deploying,

publishing, and invoking Web services

• Modeling, testing, and debugging Web services

• Browsing UDDI registry to locate Web services

• Generating stub files to consume Web services

Page 12: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-15 Copyright © 2005, Oracle. All rights reserved.

SOAP: XML Messaging for Web Services

• Introduces a self-describing data representation format in XML

• Represents request and response as XML messages

• Supports both RPC-style and document-style invocation

• Uses HTTP and other protocols at transport layer• Supports data encoding and literal styles• SOAP hides details of implementations; works

with:– Any programming language– Any operating system– Any hardware platform

Page 13: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-16 Copyright © 2005, Oracle. All rights reserved.

Communication with SOAP

Communication by using SOAP protocol includes:

• Requests to invoke a service

• Responses from service method

• Fault from a service

SOAP client

Request

Web serverFirewallResponse

Page 14: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-17 Copyright © 2005, Oracle. All rights reserved.

SOAP Messages

A SOAP message is an XML document that consists of:

• A mandatory envelope as a top-level element

• An optional header• A mandatory body• An optional fault

HTTP headers

Headers

Message name, data,and fault element

SOAP envelope

SOAP header

SOAP body

Page 15: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-19 Copyright © 2005, Oracle. All rights reserved.

Web Services DescriptionLanguage (WSDL)

• Is a description language to define Web service interfaces and how to invoke them

• Is an XML Schema for describing Web services: – Service interface definition: Describes what

message must be sent and what message is returned

– Service implementation definition: Describes to which address the message must be sent

• Allows both the messages and the operations on the messages to be defined abstractly in XML

• Answers three key questions about a Web service:– What does a service do?– How is a service accessed?– Where is a service located?

Page 16: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-20 Copyright © 2005, Oracle. All rights reserved.

WSDL

<?xml version=“1.0” encoding=“UTF-8” ?><definitions name=“Hello” ...targetNamespace=“http://tempuri.org/Hello.wsdl” ...><types> <schema targetNamespace=“http://tempuri.org/Hello.xsd ... xmlns:xsd=“http://www.w3.org/2001/XMLSchema” /></types><message name=“sayHelloOutput”>... </message><message name=“sayHelloInput”> ... </message><portType name=“HelloPortType> <operation name=“sayHello”> .... </operation></portType><binding name=“HelloBinding”> <operation> <input>..</input> <output>..</output> </operation> </binding><service ..> <port> <soap:address location=“..” /> </port></service></definitions>

Page 17: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-22 Copyright © 2005, Oracle. All rights reserved.

UDDI Registry

• Is an online electronic registry for registering businesses and Web services

• Is a specification for description and discovery

• Supports the Publishing and Inquiry APIs to publish and inquire about a Web service

Page 18: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-24 Copyright © 2005, Oracle. All rights reserved.

How UDDI Is Used

UDDI BusinessRegistry

Business portals andmarketplaces

Business user Software developer

UDDI Registry

Businessdescriptions

Servicetypes

Page 19: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-25 Copyright © 2005, Oracle. All rights reserved.

Searching for a Web Service by Using UDDI

Provider infoContact InfoDirectory ofnames

White pages

Yellow pages

Search using context such as location, service type. Point to White pages for details.

Green pages

Information about business modelTechnical details of provided serviceInformation on business process

Page 20: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-26 Copyright © 2005, Oracle. All rights reserved.

UDDI Specification

• UDDI Programmer’s API

• UDDI Data Structure Specification and XML Schema

• UDDI Replication Specification and UDDI XML Replication Schema

• UDDI Operator’s Specification

Page 21: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-27 Copyright © 2005, Oracle. All rights reserved.

tModel

• Provides metadata information about a Web service specification

• Contains references to the specification locations

• Is used for compliance check

Page 22: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-28 Copyright © 2005, Oracle. All rights reserved.

<tModel tModelKey="uuid:7716711A-1231-483F-A4B9-

36104341BA78" operator=“…” authorizedName=“…”> <name>Airport Weather</name> <description xml:lang="en">

Web Service to check weather on intl. airports</description><overviewDoc>

<description … >…</description> <overviewURL>

http://live.capescience.com/wsdl/AirportWeather.wsdl

</overviewURL> </overviewDoc>

...</tModel>

tModel

Page 23: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-31 Copyright © 2005, Oracle. All rights reserved.

UDDI Support in Oracle JDeveloper 10g

JDeveloper provides a UDDI browser with which you can:

• Define a connection to a UDDI registry instance

• Search for services: – Look up tModel by name or category

– Locate a service implementing this tModel– Add a business providing this service to the UDDI

browser

• For the located service:– Generate Web service stub/skeleton – View WSDL– View a business that provides the service

Page 24: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-32 Copyright © 2005, Oracle. All rights reserved.

UDDI Browsing with Oracle JDeveloper 10g

Page 25: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-33 Copyright © 2005, Oracle. All rights reserved.

UDDI Publishing and Browsing with Oracle Enterprise Manager

Using Oracle Enterprise Manager Application Server Control Console, you can:

• Browse and register services within the UDDI registry

• Publish Web services and deploy them to a J2EE container

• Monitor and administer Web services

Page 26: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-34 Copyright © 2005, Oracle. All rights reserved.

Utilizing External Web Services from JDeveloper

Page 27: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-35 Copyright © 2005, Oracle. All rights reserved.

Summary

In this lesson, you should have learned how to:

• Provide an overview of Web services technology

• Identify the standards used by Web services

• Identify the benefits of Web services

• Locate and invoke Web services by using SOAP, WSDL, and UDDI

• Distinguish between RPC-style and Document-style Web service

Page 28: 18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services

18-36 Copyright © 2005, Oracle. All rights reserved.

Practice 18-1: Overview

This practice covers revision questions on Web services technology and standards such as SOAP, WSDL, and UDDI.