Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE 6331 © Leonidas Fegaras Web Services1 Web Services (adapted from Erdogan Dogdu's presentation) Leonidas Fegaras.

Similar presentations


Presentation on theme: "CSE 6331 © Leonidas Fegaras Web Services1 Web Services (adapted from Erdogan Dogdu's presentation) Leonidas Fegaras."— Presentation transcript:

1 CSE 6331 © Leonidas Fegaras Web Services1 Web Services (adapted from Erdogan Dogdu's presentation) Leonidas Fegaras

2 CSE 6331 © Leonidas Fegaras Web Services2 What are Web Services? Services available via the Web –Mostly for application-to-application communication –Enables business-to-business transactions Examples: –stock quote service –weather service –map service –Web search service Based on XML SOAP: Simple Object Access Protocol WSDL: Web Service Description Language UDDI: Universal Description, Discovery, and Integration

3 CSE 6331 © Leonidas Fegaras Web Services3 SOAP A lightweight protocol for exchanging information in a distributed, heterogeneous environment Enables cross-platform interoperability –programming language neutral –hardware independent –protocol independent Works over existing Internet infrastructure Builds on XML standards Defines –message format –data encoding –headers for sending messages & receiving responses

4 CSE 6331 © Leonidas Fegaras Web Services4 A SOAP Request SOAP requests are HTTP POST requests POST /WebCalculator/Calculator.asmx HTTP/1.1 Content-Type: text/xml SOAPAction: http://tempuri.org/Add Content-Length: 386...

5 CSE 6331 © Leonidas Fegaras Web Services5 Message Layout SOAP Message SOAP Envelope SOAP Header SOAP Body Message Name & Data Headers XML-encoded SOAP message name & data contains SOAP message name Individual headers encloses headers encloses payload Protocol binding headers The complete SOAP message

6 CSE 6331 © Leonidas Fegaras Web Services6 Message Format The SOAP schema can be defined in an XML document... 12 10

7 CSE 6331 © Leonidas Fegaras Web Services7 Server Response HTTP/1.1 200 OK... Content-Type:text/xml Content-Length: 391 28.6

8 CSE 6331 © Leonidas Fegaras Web Services8 Data are in XML Plastic Novelties Ltd 129 PLAS

9 CSE 6331 © Leonidas Fegaras Web Services9 Example of a Request POST /StockQuote HTTP/1.1 Host: www.stockquoteserver.com Content-Type: text/xml; charset="utf-8" Content-Length: nnnn SOAPAction: "Some-URI <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV: encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> DIS

10 CSE 6331 © Leonidas Fegaras Web Services10 Example of a Response HTTP/1.1 200 OK Content-Type: text/xml; charset="utf-8" Content-Length: nnnn <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV: encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 34.5

11 CSE 6331 © Leonidas Fegaras Web Services11 WSDL: Web Services Description Language XML schema for describing Web Services –Service interface definition abstract semantics for Web Service –Service implementation definition concrete end points and network addresses where Web Service can be invoked Used primarily (although not exclusively) to describe SOAP services Describes four critical pieces of data: –Interface information describing all publicly available functions –Data type information for all message requests and message responses –Binding information about the transport protocol to be used –Address information for locating the specified service

12 CSE 6331 © Leonidas Fegaras Web Services12 Main Structure xschema types … a set of operations communication protocols a list of binding and ports

13 CSE 6331 © Leonidas Fegaras Web Services13 WSDL Parts define types used in message declaration –XML Schema must be supported by any vendor of WSDL conformant products The element defines the data elements of an operation –each message may consist of one or more parts similar to the parameters of a function call in a traditional programming language The defines a web service, the operations that can be performed, and the messages that are involved –defines the connection point to a web service, an instance of. –similar to a function library in a traditional programming language –each operation can be compared to a function in a traditional programming language

14 CSE 6331 © Leonidas Fegaras Web Services14 Example: HelloService.wsdl <definitions name="HelloService" targetNamespace="http://www.ecerami.com/wsdl/HelloService.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.ecerami.com/wsdl/HelloService.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

15 CSE 6331 © Leonidas Fegaras Web Services15 Example (cont.) <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:helloservice" use="encoded"/> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:helloservice" use="encoded"/>

16 CSE 6331 © Leonidas Fegaras Web Services16 Example (cont.) WSDL File for HelloService <soap:address location="http://localhost:8080/soap/servlet/rpcrouter"/>

17 CSE 6331 © Leonidas Fegaras Web Services17 WSDL Invocation Tools You can use any SOAP method to call HelloService Using the GLUE tool: invoke URL method arg1 arg2 arg3... To invoke the HelloService with GLUE –place the HelloService.wsdl file within a publicly available directory –issue the command: invoke http://localhost:8080/wsdl/HelloService.wsdl sayHello World GLUE will –download the specified WSDL file –invoke the sayHello method –pass World as a parameter Server response: result = Hello, World!

18 CSE 6331 © Leonidas Fegaras Web Services18 UDDI UDDI = Universal Description, Discovery, and Integration Industry initiative to address discovery –a registration database for Web Services Specifications –schema for service providers and descriptions –API for publishing and searching –developed on industry standards (XML, HTTP, TCP/IP, SOAP) –applies to both XML and non-XML services Implementation –public and private instances of specification

19 CSE 6331 © Leonidas Fegaras Web Services19 Providers, Services and Bindings Providers –Examples: Accounting Department, Corporate Application Server –Name, Description, Contact Information –Categorization and Identification Information Services –Examples: Purchase Order services, Payroll services –Name, Description(s) –Categorization Information Bindings –Description(s), access points, parameters –Examples: Access Point (http://...) for Web Service

20 CSE 6331 © Leonidas Fegaras Web Services20 Features Neutral in terms of protocols –as a registry, it can contain pointers to anything Can search by business, service, Web Service, binding Usage of Globally Unique Identifiers (GUIDs) Specification allows public and private nodes Delineation between interface and implementation

21 CSE 6331 © Leonidas Fegaras Web Services21 tModel represents meta-data and interfaces microsoft-com:creditcheck Check credit limits http://schema.com/creditcheck.wsdl <keyedReference tModelKey="UUID:CD153257-086A-4237-B336-6BDCBDCC6634" keyName="Consumer credit gathering or reporting services" keyValue="84.14.16.01.00"/> <keyedReference tModelKey="UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4" keyName="types" keyValue="wsdlSpec"/>

22 CSE 6331 © Leonidas Fegaras Web Services22 bindingTemplate A bindingTemplate represents data and implementation details http://localhost/HelloWorld/Service1.asmx


Download ppt "CSE 6331 © Leonidas Fegaras Web Services1 Web Services (adapted from Erdogan Dogdu's presentation) Leonidas Fegaras."

Similar presentations


Ads by Google