web services web services
play

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


  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

  2. What is WSDL? What is WSDL? What is WSDL? Web Services Web Services 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

  3. Role of WSDL in WS scene Role of WSDL in WS scene Role of WSDL in WS scene Service Web Services Web Services UDDI Broker registry register service lookup WSDL WSDL doc SOAP/WSDL client service SOAP req Service Requestor Service Provider SOAP res

  4. Aspects of Service Description Aspects of Service Description Aspects of Service Description Web Services Web Services 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?

  5. Two Key Concepts for WSDL Two Key Concepts for WSDL Two Key Concepts for WSDL Web Services Web Services • Services are a collections of network endpoints, or ports • Separation between the abstract definition of an endpoint, and its concrete network deployment

  6. WSDL Terminology WSDL Terminology WSDL Terminology Web Services Web Services • 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

  7. WSDL Elements (I) WSDL Elements (I) WSDL Elements (I) Web Services Web Services • <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

  8. WSDL Elements (II) WSDL Elements (II) WSDL Elements (II) Web Services Web Services • <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

  9. <definitions> </definitions> <definitions> </definitions> <definitions> </definitions> Web Services Web Services • Can specify a name for the service Also defines additional namespaces • used in the rest of the document c o d e s m i a h n t e y c i b v r e d s e <definitions n i f e d name ="HertzReserveService“ s n 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" O > t h e r u ... [“body” of the WSDL document] s e d n s </definitions>

  10. <types> </types> <types> </types> <types> </types> Web Services Web Services • 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)

  11. <message> </message> <message> </message> <message> </message> • “name” attribute specifies the message name Web Services Web Services • <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>

  12. <portType portType> </ > </portType portType> > <portType> </portType> < Web Services Web Services • 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

  13. PortType operations examples operations examples PortType PortType operations examples <operation name="search"> Web Services Web Services Request- <input message="searchRequest"/> response <output message="searchResponse"/> </operation> <operation name="resourceControl"> Solicit- <output message="resourceControlResponse"/> response <input message="resourceControlRequest"/> </operation> <operation name="triggerResourceControl"> One-way <input message="triggerResourceControlRequest"/> </operation> <operation name="segment"> Notification <output message="segmentRequest"/> </operation>

  14. <binding></binding> <binding></binding> <binding></binding> e p y T t r o p Web Services Web Services <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

  15. SOAP Binding SOAP Binding SOAP Binding Web Services Web Services • 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, …

  16. <service> </service> <service> </service> <service> </service> Web Services Web Services • Service element specifies location of 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

  17. <service> example <service> example <service> example Web Services Web Services <service name="Oxford University Libraries"> s t n e m m o c e <documentation> m a n g Z39.50 Server for Oxford University Libraries n i d n </documentation> i B <port name ="OLIS" binding="ez:ez3950SOAPBinding"> <soap:address location="http://jafer.las.ox.ac.uk/ez3950"/> l </port> o c a t i o n </service>

  18. <import> <import> <import> • Its purpose is similar to that of C/C++ #include: Web Services Web Services 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" /> L o c a l r e f <import namespace ="http://asf.gils.net/xer" location =http://asf.gils.net/xer/ez.xsd A b s /> o l u t e r e f

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend