Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web services. The SOAP Data Model, Schema Validation, and Introduction to WSDL. February 16, 2006.

Similar presentations


Presentation on theme: "Web services. The SOAP Data Model, Schema Validation, and Introduction to WSDL. February 16, 2006."— Presentation transcript:

1 Web services. The SOAP Data Model, Schema Validation, and Introduction to WSDL. February 16, 2006.

2 Today. ● The SOAP data model. ● Exercise: validating XML documents. ● Introduction to WSDL. ● Assignment 1.

3 SOAP data model. Mapping XML Schema to known data structures (e.g. Java) is hard! 1. SOAP data model (Java like). 2. SOAP encoding (data model to XML).

4 SOAP data model for a product in Skatextown's database. 947-ti 129 36 skateboard Titanium glider free style titanium skateboard product VALUES (simple) LABELS (accessors) numinstock unit price sku description type name

5 A Java object representation: class Product { String description; //accessor names String sku; double unitPrice; String name; String type; int numInStock; }

6 SOAP data model values. ● Simple values, ● compound values, ● structured values. ● array values, ● multireference values (multirefs)

7 XML encoding. SOAP encoding rules: data model --> XML Use soap encoding name space (URI): http://www.w3.org/2003/05/soap-encoding

8 Encoding style attribute 947-TI Titanium Glider skateboard Street-style titanium skateboard. 129.00 36

9 Encoding rules, simple. ● outgoing edge --> XML element. ● teminal value --> text child. ● non-terminal value --> XML subelements

10 object graph with loop. Fido Joe name pet owner name

11 Encoding multirefs. Joe Fido

12 Ordered data structure. oldest middle youngest Huey Duey Louie

13 Encoding arrays. Huey Duey Louie

14 Encoding rules, multirefs & arrays Multirefs: ● The referenced object: enrich the generated element with an ID attribute (an anchor). Arrays ● ItemType attribute describes the element content type. Array length is given by arraySize attribute.

15 Exercise: Transform the depicted object graph into XML and write a schema. Validate the schema.

16 Validating XML docs against XML Schemas. Go to ftp://evarose.netftp://evarose.net download validating.zip

17 Calling a web service. Service requester will need a service description: ● a textual description of the service, ● include sample message formats in the documentation, or ● a formal service description, in order to send a SOAP request message.

18 What to specify. ● Ordinary middleware: service operations, (service name, service signature). ● Web services: service access mechanisms (transport protocol, service location) Summary: ● service interface, ● protocol binding, ● endpoint address information.

19 Web service specification structure. WSDL (XML document). Abstract part Concrete part Protocol bindings, endpoints / ports.. Interface of supported operations: service name, service signature (in-out parameters).

20 Abstract (interface) WSDL part TYPES MESSAGES OPERATIONS PORT TYPES

21 The WSDL interface part. ● Types. Data structures for the units (parts) which are exchanged. ● Messages. Consists of parts. ● Operations. Define the transmission primitives/ interactions. ● Port types. Assembles operations in related groups.

22 Example: Price check service. Purpose: extending the “inventorycheck” web service to include price information, and availability. Request: “product SKU number” Response: “price” and “available units”

23 Concrete WSDL part BINDINGS. SERVICES AND PORTS.

24 The Concrete WSDL part ● Interface bindings. Specifies message encoding (SOAP encoded or literal), interaction style (RPC or document), and protocol binding per port type. ● Ports. Locations. Specifies EndPoint or network address where the implementation of the port type can be accessed. ● Services. Logical groupings of ports.

25 EBNF-style WSDL specification. {.. } [.. ] {.. }

26 The XML schema for WSDL Any WSDL document must conform to the XML Schema at http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd Try it!

27 The element <definitions name="PriceCheck" targetNameSpace="http://www.skatestown.com/services/P riceCheck" xmlns:pc="http://www.skatestown.com/services/PriceChec k" xmlns:avail="http://www.skatestown.com/ns/availability" xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl" >

28 See you next week. Assignment 1 is due February 23. We continue with WSDL (Chap 4) and related concepts.


Download ppt "Web services. The SOAP Data Model, Schema Validation, and Introduction to WSDL. February 16, 2006."

Similar presentations


Ads by Google