1 / 23

What is WSDL?

T-110.5140 Network Application Frameworks and XML Web Services and WSDL 28.3.2006 Sasu Tarkoma Based on slides by Pekka Nikander. What is WSDL?. WSDL: Web Service Description Language An XML language used to describe and locate web services location of web service methods that are available

megan-ware
Download Presentation

What is WSDL?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. T-110.5140 Network Application Frameworks and XML Web Services and WSDL28.3.2006Sasu Tarkoma Based on slides by Pekka Nikander

  2. What is WSDL? • WSDL: Web Service Description Language • An XML language used to describe and locate web services • location of web service • methods that are available • data type information and XML messages • Commonly used to describe SOAP-based services • W3C standard (work in progress) • Initial input: WSDL 1.1 as W3C Note • Current version 2.0 (Candidate Recommendation) • Some differences between 1.1 and 2.0 • WSDL 1.1 in WS-I Basic Profile 1.0 and 1.1.

  3. WSDL Document Elements (v.1.1.) • <types> - data type definitions • <message> - Abstract definition of the data being transmitted • <portType> - A set of abstract operations • <binding> - Concrete protocol and data format specifications for the operations and messages defined by a particular portType. Endpoint type. • <port> - An address for binding. Endpoint instance. • <service> - A set of ports.

  4. WSDL Overview <definitions>: ROOT WSDL element <types>: The data types that are used <message>: What messages are transmitted? <portType>: The supported operations <binding>: The binding to concrete protocols <service>: Reference to actual location

  5. A WSDL Document • A WSDL document contains two parts • Abstract part • Interfaces, types, messages • Concrete part • Binding to conrete protocol and encoding • May be published separately • Interfaces agreed between many companies • Each company published their own implementation in UDDI and import the abstract interface.

  6. Mapping SOAP to WSDL

  7. Message Styles • The WSDL 1.1 specification defines two SOAP message styles • Determined in binding • Document • <soap:Body> contains one or more child elements called parts • There are no SOAP formatting rules for what the <soap:Body> contains • preferred, loose coupling, easy validation • RPC • <soap:Body> contains an element with the name of the method or remote procedure being invoked • This element in turn contains an element for each parameter of the procedure • less popular today, tighter coupling

  8. The main structure (v.1.1) <definitions namespace = "http://.."> <types>XML Schema types</types> <message>..</message> <portType>a set of operations</portType> <binding>Communication protocols</binding> <service>A list of binding and ports</service> </definitions>

  9. Types • <types> define data types used in message declaration • For platform neutrality, WSDL uses XML Schema syntax to define data • XML Schema must be supported by any vendor of WSDL conformant products • Other kinds of type definitions also possible • Possible interoperability issues • If the service uses only XML Schema built-in simple types, such as strings and integers, the types element is not required

  10. WSDL Messages • The <message> element defines the data elements of an operation • the name of the message • contains zero or more message part elements • The parts can be compared to the parameters of a function call in a traditional programming language • All parts are typed by an XML Schema type • V.2.0 changes: message element is not used, replaced by patterns

  11. WSDL Ports • The <portType> element is the most important WSDL element • The operations that can be performed, the messages that are involved • A <port> defines the connection point to a web service, an instance of <portType> • It can be compared to a function library (or a module, or a class) in a programming language

  12. Operation Types (v.1.1) • One-Way: The operation can receive a message but will not return a response • Request-Response: The operation can receive a request and will return a response • Solicit-Response: The endpoint sends an output message and then receives an input message. • Notification: The operation can send a message but will not wait for a response • v.2.0 changes: abstract message patterns

  13. <message name="GetLastTradePriceInput"> <part name="body" element="TradePriceRequest"/> </message> <message name="GetLastTradePriceOutput"> <part name="body" element="TradePrice"/> </message> <message name=”ExampleInteraction"> <part name="index" type="xsd:integer"/> <part name="name" type="xsd:string" /> </message>

  14. Example <portType name="StockQuotePortType"> <operation name="GetLastTradePrice"> <input message="tns:GetLastTradePriceInput"/> <output message="tns:GetLastTradePriceOutput"/> </operation> </portType>

  15. One way and Notification Example <portType name="RegisterPort"> <operation name="register"> <input name="customerInfo" message="RegInfo"/> </operation> <operation name="registerResponse"> <output name="response" message="ResponseInfo"/> </operation> </portType>

  16. Putting it together Source: http://msdn.microsoft.com/

  17. WSDL 2.0 • 3 specifications • Part 1: Core • Abstract interfaces, independent of protocol and encoding • Part 2: Message Exchange Patterns • Predefined types of interactions • Part 3: Bindings • SOAP and HTTP/MIME binding • Lot’s of changes from 1.1

  18. Changes from 1.1 to 2.0 • Adding further semantics to the description language. • Removal of message constructs. These are specified using the XML schema type system in the types element. • No support for operator overloading. • PortTypes renamed to interfaces. Support for interface inheritance is achieved by using the extends attribute in the interface element. • Ports renamed to endpoints. • Abstracted message patterns

  19. WSDL 2.0 Conceptual Model Source: http://webservices.xml.com/pub/a/ws/2004/05/19/wsdl2.html

  20. Message Exchange Patterns MEP Description Fault in-only Single input message No robust-in-only Single input message Trigger In-out Input message + output message Replace out-only Single output message No robust-only-out Single output message Trigger out-in Output followed by input msg Replace out-optional-in Output followed by an opt. Input Trigger in-optional-out Input followed by an opt. Output Trigger

  21. Implementations • Microsoft .NET • SOAP 1.1, WSDL 1.1 • Java API for XML-based RPC (JAX-RPC) • SOAP 1.1, WSDL 1.1 • Java API for XML Registries (JAXR) • Apache Axis • Tools for automatically creating WSDL to/from Java • SOAP 1.1 and 1.2, WSDL 1.1, JAX-RPC 1.0 • Axis2 supports WSDL 2.0 component model • IBM Websphere, BEA Web Logic, SAP NetWeaver, …

  22. Uses of WSDL documents • Description of service interfaces • Compile-time • Developer uses WSDL before service deployment • Run-time • Client downloads WSDL description and uses the info it provides to execute the service • As a side-effect • Developers can use WSDL to speed up the development of code • WSDLJava code • Java interfaces  WSDL

  23. Summary • Deferred binding, using Web, composition • Some details and conventions still unclear • Possible interoperability issues • Parts hard to understand • Namespaces • Schemas • Differences between versions • Document vs. RPC SOAP style • Also literal vs. encoded • More about this next week

More Related