Web Services Web Services WSDL WSDL WSDL Stop a while to read - - PowerPoint PPT Presentation

web services web services
SMART_READER_LITE
LIVE PREVIEW

Web Services Web Services WSDL WSDL WSDL Stop a while to read - - PowerPoint PPT Presentation

Web Services Web Services WSDL WSDL WSDL Stop a while to read about me! Part of the code shown in the following slides is taken from the book Java Web Services by D.A. Chappell and T. Jawell, OReilly, ISBN 0- 596-00269-6 What is


slide-1
SLIDE 1

Web Services Web Services

WSDL WSDL WSDL

Stop a while to read about me!

Part of the code shown in the following slides is taken from the book “Java Web Services” by D.A. Chappell and T. Jawell, O’Reilly, ISBN 0- 596-00269-6

slide-2
SLIDE 2

Web Services Web Services

What is WSDL? What is WSDL? What is WSDL?

Web Services Description Language Service Description: A contract between service provider and consumer

  • Platform and language independent (unlike XML-RPC)
  • Tools automate process of locating,

invoking web service functionality

slide-3
SLIDE 3

Web Services Web Services

Role of WSDL in WS scene Role of WSDL in WS scene Role of WSDL in WS scene

UDDI registry

Service Broker

SOAP/WSDL service

Service Provider

client

Service Requestor lookup WSDL register service SOAP req SOAP res

WSDL doc

slide-4
SLIDE 4

Web Services Web Services

Aspects of Service Description Aspects of Service Description Aspects of Service Description

WSDL describes four aspects of the service:

  • Interface information

− What methods are publicly available?

  • Data type information

− What info is needed by message requests and sent

back by responses?

  • Binding information

− Which “transport protocols” can be used?

  • Address information

− Where is the service located?

slide-5
SLIDE 5

Web Services Web Services

Two Key Concepts for WSDL Two Key Concepts for WSDL Two Key Concepts for WSDL

  • Services are a collections of network endpoints,
  • r ports
  • Separation between

the abstract definition of an endpoint, and its concrete network deployment

slide-6
SLIDE 6

Web Services Web Services

WSDL Terminology WSDL Terminology WSDL Terminology

  • Messages

− Description of data being exchanged

  • Port types

− Collections of operations

  • Binding

− Concrete protocol and data format specifications

for a particular port type

  • Port

− Binding + network address

  • Service

− Collection of ports

slide-7
SLIDE 7

Web Services Web Services

WSDL Elements (I) WSDL Elements (I) WSDL Elements (I)

  • <definitions> … </definitions>

− Root element of WSDL specification − Defines name of the web service, multiple namespaces

  • <types>…</types>

− Describes types used between the client and server − Default: XML Schema specification

  • <message>…</message>

− Describes data exchanged in WS usage − A one-way message, containing zero or more

<part>…</part> elements

slide-8
SLIDE 8

Web Services Web Services

WSDL Elements (II) WSDL Elements (II) WSDL Elements (II)

  • <portType>…</portType>

− Combines multiple messages to form operation(s)

  • <binding>…</binding>

− Specifics of how a service (portType) is actually

implemented in terms of a protocol, SOAP specifics, …

  • <service>…</service>

− One or more ports, each with its own network address

slide-9
SLIDE 9

Web Services Web Services

<definitions

name="HertzReserveService“ targetNamespace="http://oreilly.jaws.book/chapter03/hertz_rese

rve" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://oreilly.jaws.book/chapter03/hertz_reserve" xmlns:defs="http://oreilly.jaws.book/chapter03/definitions" xmlns:hrs="http://oreilly.jaws.book/chapter03/schemas" > ... [“body” of the WSDL document] </definitions>

n s d e f i n e d b y t h i s d

  • c

s e r v i c e n a m e O t h e r u s e d n s

<definitions> </definitions> <definitions> </definitions> <definitions> </definitions>

  • Can specify a name for the service
  • Also defines additional namespaces

used in the rest of the document

slide-10
SLIDE 10

Web Services Web Services

<types> </types> <types> </types> <types> </types>

  • Defines the types used in messages
  • WSDL itself is not tied to any specific typing

system, but it uses the XML

  • Schema specification (XSD) is the default choice
  • Built-in types,

simple and complex types (as possible through XML Schema)

slide-11
SLIDE 11

Web Services Web Services

<message> </message> <message> </message> <message> </message>

  • “name” attribute specifies the message name
  • <part> … </part> specifies one data item (type + name)
  • By convention, SOAP RPC msgs have only one <part></part>

element: a structure containing the actual parameters

<message name="soapHeader"> <part type="xsd:string" name="id"/> <part type="xsd:string" name="timeout"/> </message> <message name="initRequest"> <part type="xer:initRequest" name="initRequest"/> </message>

slide-12
SLIDE 12

Web Services Web Services

<portType> </portType> < <portType portType> </ > </portType portType> >

  • An abstract collection of operation(s)
  • Each operation consists of a pattern of messages
  • Message names must be namespace-qualified
  • Four basic patterns

− One-way − Request-response − Solicit-response − Notification

slide-13
SLIDE 13

Web Services Web Services

PortType operations examples PortType PortType operations examples

  • perations examples

<operation name="search"> <input message="searchRequest"/> <output message="searchResponse"/> </operation> <operation name="resourceControl"> <output message="resourceControlResponse"/> <input message="resourceControlRequest"/> </operation> <operation name="triggerResourceControl"> <input message="triggerResourceControlRequest"/> </operation> <operation name="segment"> <output message="segmentRequest"/> </operation>

Request- response Solicit- response One-way Notification

slide-14
SLIDE 14

Web Services Web Services

<binding></binding> <binding></binding> <binding></binding>

<binding name="MainClassSoap" type="s0:MainClassSoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> <operation name="Compute"> <soap:operation soapAction="http://www…" style="document" /> <input> <soap:body use="literal" /> </input> <output> <soap:body use="literal" /> </output> </operation> </binding>

  • Provides information about how “Compute” operation

messages are transported over the Internet

p

  • r

t T y p e

slide-15
SLIDE 15

Web Services Web Services

SOAP Binding SOAP Binding SOAP Binding

  • Built-in extensions to express SOAP-specific details

− SOAP headers, encoding styles − SOAPAction HTTP header (identifies the service)

  • <soap:binding>

− Indicates binding will be made available via SOAP − style attribute indicates message format

document: simple XML documents (.NET preference) rpc: additional wrapper element indicating the function name

  • <soap:operation>

− Indicates binding of a specific operation to a specific SOAP

implementation (SOAPAction header)

  • <soap:body>

− For each operation, specifies details of the input/output

messages

Encoding, header blocks, headerfault, fault, …

slide-16
SLIDE 16

Web Services Web Services

<service> </service> <service> </service> <service> </service>

  • Service element specifies location
  • f one or more ports

− binding denotes portType (hence, operations,

messages, types)

− location provides info about where service is

“physically” accessible

soap:address value goes into HTTP POST header Used by the SOAP-enabled web server to route SOAP requests

  • Can optionally contain human-readable

documentation describing the service

slide-17
SLIDE 17

Web Services Web Services

<service> example <service> example <service> example

<service name="Oxford University Libraries"> <documentation> Z39.50 Server for Oxford University Libraries </documentation> <port name="OLIS" binding="ez:ez3950SOAPBinding"> <soap:address location="http://jafer.las.ox.ac.uk/ez3950"/> </port> </service>

B i n d i n g n a m e c

  • m

m e n t s l

  • c

a t i

  • n
slide-18
SLIDE 18

Web Services Web Services

<import> <import> <import>

  • Its purpose is similar to that of C/C++ #include:

allows the elements of a service definition to be organized upon separate independent files

  • A WSDL document can have none or multiple <import> elements
  • The <import> scope is the element the tag is used within
  • The import action operates through namespaces

<import namespace="http://oreilly.jaws.book/ch03/definitions" location="file:///d:/jaws/ch03/wsdl/hr/hertz_reserve.wsdl" /> <import namespace="http://asf.gils.net/xer" location=http://asf.gils.net/xer/ez.xsd />

L

  • c

a l r e f A b s

  • l

u t e r e f