CSE 636 Data Integration Web Services What is
CSE 636 Data Integration Web Services
What is a Web Service • A web service is a network accessible interface to application functionality – Application interoperability across different platforms – Built using standard Internet technologies • Clients of web services do NOT need to know how they are implemented Application Client Network Web Service Application Code 2
Web Services Related Standards • Web Services Description Language (WSDL) 1. 1 – http: //www. w 3. org/TR/wsdl (03/01) – Version 2. 0 under development • Simple Object Access Protocol (SOAP) – http: //www. w 3. org/TR/soap/ • Universal Description, Discovery and Integration (UDDI) – http: //www. uddi. org/ 3
Web Service Technology Stack Shopping web service? Discovery Description WSDL URIs Web Service Client UDDI Web Service WSDL SOAP/HTTP request Messaging Transport Proxy SOAP/HTTP response Hyper. Text Transfer Protocol (HTTP) 4
Part 1: Web Service Methods Shopping web service? Discovery Description WSDL URIs Web Service Client UDDI Web Service WSDL SOAP/HTTP request Messaging Transport Proxy SOAP/HTTP response Hyper. Text Transfer Protocol (HTTP) 5
Part 2: Web Service Description Shopping web service? Discovery Description WSDL URIs Web Service Client UDDI Web Service WSDL SOAP/HTTP request Messaging Transport Proxy SOAP/HTTP response Hyper. Text Transfer Protocol (HTTP) 6
Part 3: Proxy to Access Web Service Shopping web service? Discovery Description WSDL URIs Web Service Client UDDI Web Service WSDL SOAP/HTTP request Messaging Transport Proxy SOAP/HTTP response Hyper. Text Transfer Protocol (HTTP) 7
Part 4: Client to Invoke Proxy Shopping web service? Discovery Description WSDL URIs Web Service Client UDDI Web Service WSDL SOAP/HTTP request Messaging Transport Proxy SOAP/HTTP response Hyper. Text Transfer Protocol (HTTP) 8
Data Services Architecture Web Application Server WSDL Web Service Client SOAP/HTTP request WSDL Web Service Parameter Instantiation Parameterized XQuery Expressions SOAP/HTTP response Query Result Query Execution XML Database XML Schema XML File 9
Web Services Definition Language (WSDL) • Defines servicesas collections of network endpoints • Consists of abstract definitions – Types – Messages – Port Types & Operations • and concrete implementations – Bindings – Services & Ports • Broken into pieces for reuse purposes 10
Port Types & Operations Port Type: An abstract set of operations supported Operation: An abstract description of an action supported <port. Type name="Address. Book"> <operation name="add. Entry"> <input message="tns: Add. Entry. Request"/> <output message="tns: empty"/> </operation> <operation name="get. Address. From. Name"> <input message="tns: Get. Address. From. Name. Request"/> <output message="tns: Get. Address. From. Name. Response"/> </operation> </port. Type> • Programming languages refer to a port type as a class, and to an operation as a method 11
Messages • Abstract, typed definitions of the data being communicated <message name="empty"/> <message name="Add. Entry. Request"> <part name="address" type="tns: address"/> </message> <message name="Get. Address. From. Name. Request"> <part name="name" element="tns: entry. Name"/> </message> <message name="Get. Address. From. Name. Response"> <part name="address" type="tns: address"/> </message> 12
Types • Data type definitions using the XML Schema type system <types> <xs: schema target. Namespace="urn: Address. Fetcher" xmlns: xs="http: //www. w 3. org/1999/XMLSchema"> <xs: element name="entry. Name" type="xs: string"/> <xs: complex. Type name="address"> <xs: all> <xs: element name="street. Num" type="xs: int"/> <xs: element name="street. Name" type="xs: string"/> <xs: element name="city" type="xs: string"/> <xs: element name="state" type="xs: string"/> <xs: element name="zip" type="xs: int"/> <xs: element name="phone. Number" type="xs: int"/> </xs: all> </xs: complex. Type> </xs: schema> </types> 13
WSDL File Structure <definitions name="urn: Address. Fetcher" target. Namespace="urn: Address. Fetcher" xmlns: tns="urn: Address. Fetcher" xmlns: xs="http: //www. w 3. org/1999/XMLSchema" xmlns: soap="http: //schemas. xmlsoap. org/wsdl/soap/" xmlns="http: //schemas. xmlsoap. org/wsdl/"> <types>…</types> <message name="Add. Entry. Request">…</message> … <port. Type name="Address. Book">…</port. Type> Type Definitions Message Declarations Port Type Declarations <binding>…</binding> Binding Declarations <service>…</service> Service Declaration </definitions> 14
Bindings • Concrete protocol and data format specifications for a particular port type <binding name="Address. Book. SOAPBinding" type="tns: Address. Book"> <soap: binding style="document" transport="http: //schemas. xmlsoap. org/soap/http"/> <operation name="get. Address. From. Name"> <soap: operation soap. Action=""/> <input> <soap: body use="literal"/> </input> <output> <soap: body use="literal"/> </output> </operation> … </binding> 15
Services & Ports • Port: a single endpoint defined as a combination of a binding and a network address • Service: a collection of related endpoints <service name="Address. Book. Service"> <port name="Address. Book" binding="tns: Address. Book. SOAPBinding"> <soap: address location="http: //localhost: 8080/axis/services/Address. Book"/> </port> </service> 16
Not Discussed • Types of operations: – One-way: The endpoint receives a message – Request-response : The endpoint receives a message, and sends a correlated message – Solicit-response : The endpoint sends a message, and receives a correlated message – Notification : The endpoint sends a message • Alternative Bindings: – HTTP: Using GET and POST – MIME • SOAP – RPC-Style Web Services • UDDI 17
- Slides: 17