Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Services 1 Oren Shamir Gal Moshitch. Web Services 2 Contents The World and the Problem Historical solutions Brief history of Web Services WS: The.

Similar presentations


Presentation on theme: "Web Services 1 Oren Shamir Gal Moshitch. Web Services 2 Contents The World and the Problem Historical solutions Brief history of Web Services WS: The."— Presentation transcript:

1 Web Services 1 Oren Shamir Gal Moshitch

2 Web Services 2 Contents The World and the Problem Historical solutions Brief history of Web Services WS: The Technology WS: The Tools Beyond WS Demo

3 Web Services 3 Lecture Goals Understand Web Services technology Introduce audience to WS tools Discuss future of WS

4 Web Services 4 Local Method invocation Local method invocation, single language Write program Compile with headers Link with libraries Local method invocation, multiple languages Write program Pre-compilation, create stubs Compile with stub headers Link with stubs

5 Web Services 5 Remote Method invocation Remote method invocation, single language RPC, DCOM / COM+ RMI – java's Remote Method Invocation

6 Web Services 6 The problem Programming interfaces are usually... Programming language dependent OS dependent Machine code dependent Remote invocation is usually also... Serialization challenged Transport layer dependent

7 Web Services 7 Historical solutions CORBA – Common Object Request Broker Architecture V1.0 released 1991 Is a “vendor-independent architecture and infrastructure that computer applications use to work together over networks” Uses IDL – Interface Definition Language Supports C, C++, Java, COBOL, Smalltalk, Ada, Lisp, Python and more

8 Web Services 8 Historical solutions CORBA – Common Object Request Broker Architecture Works over IIOP Is it in use ?

9 Web Services 9 History of associated tech. SGML - “Simple” manipulation language (Standard, 86`). Designed for documents, technical manuals. Very complicated, used in large organizations. HTML – Hyper-text manipulation language XML – eXtensible Manipulation Language Provides 80% of SGML functionality at 20% complexity

10 Web Services 10 History of associated tech. XML allows user to define data tags Usage of data is up to applications John Doe 2 Backroads Lane New York 045935435 john.doe@gmail.com

11 Web Services 11 History of associated tech. XML schema (XSD) defines the structure of an XML document XSD also defines XML data types: Boolean Byte Date String Base64Binary And more

12 Web Services 12 History of associated tech. The Internet Required interoperability Homogenous systems Needs simple access Firewalls Usually block ports and protocols Data-sensing firewalls

13 Web Services 13 Presenting: Web Services A method invocation standard W3C standard, backed by IBM, MS Works by passing XML text messages Does not deal with object models

14 Web Services 14 Presenting: Web Services Publishers Developers

15 Web Services 15 Usage Model The Web Services architecture is based upon the interactions between three roles: Service provider Service registry Service requester The interactions involve: Publish operations Find operation Bind operations

16 Web Services 16 Presenting: Web Services SOAP – Simple Object Access Protocol – A standard way for communication WSDL – Web Services Description Language – A standard meta language to describe the services offered UDDI – Universal Description, Discovery and Integration specification – A mechanism to register and locate WS based application

17 Web Services 17 Web Services: SOAP SOAP – Simple Object Access Protocol – A standard way to define communication processes XML vocabulary that defines ways to pass formatted messages across networks Supports multiple underlaying transport protocols SOAP envelope

18 Web Services 18 Web Services: SOAP Soap header Optional Holds control data Contains “header blocks” Soap body Mandatory Contains data Optional “fault” section

19 Web Services 19 Web Services: SOAP <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle=http://www.w3.org/2001/12/soap-encoding”> uuid:9832-132-9892d IBM

20 Web Services 20 Web Services: SOAP SOAP envelopes can contain any data WS SOAP envelopes contain RPC requests and responses To invoke a SOAP call, we need SOAP node address Procedure name, parameters, return val

21 Web Services 21 Web Services: SOAP SOAP example: Xmethods website provides web method definitions and invocation interface http://www.xmethods.com/ve2/index.po

22 Web Services 22 Web Services: WSDL WSDL – Web Services Description Language Implements the “Publish” functionality for Web Services Is an XML-Formatted document describing the service The WSDL is the “.h” of WS

23 Web Services 23 Web Services: WSDL The WSDL describes... Data types Message types to be communicated Operations, sets of messages Port types, sets of operations Binding – concrete protocol binding for a port type Ports and Services

24 Web Services 24 Web Services: WSDL <definitions name="StockQuote"..

25 Web Services 25 Web Services: WSDL..

26 Web Services 26 Web Services: WSDL Example: http://www.xmethods.com/ve2/index.po

27 Web Services 27 Web Services: UDDI UDDI – Universal Description, Discovery and Integration - “API Yellow Pages” Enables the “Search” functionality Service providers advertise services via UDDI registry Service consumers discover services via UDDI registry

28 Web Services 28 Web Services: UDDI Evolved to “speed interoperability and adoption of web services” An easy way to expose B2B or C2B programmable interfaces Adds to “Hype”

29 Web Services 29 Web Services: UDDI Three registration levels: White pages – Business name, description, contact info. One per company Yellow pages – Business categories, attached to white pages Green pages – How to e-commerce with business: Service and Binding information

30 Web Services 30 WS Tools Web Services are a standard Need toolkits to use the standard SOAP-to-Language object class mapping not standardized Implementing toolkits: Java – Apache Axis MS Visual Studio gSOAP

31 Web Services 31 WS Tools

32 Web Services 32 Axis – a Java WS Framework An Apache project Framework for constructing SOAP clients, servers, processors Contains SOAP tools, TCP/IP monitor, servlet plugins and more Java and C++ implementations

33 Web Services 33 Axis – Server Side Write a simple java class With JWS: Copy.java file to.jws file under webapps... That's it ! With WSDD (web service deployment descriptor).wsdd file describes flows and methods Can choose which methods to expose

34 Web Services 34 Axis – Client Side Dynamic Invocation 1 public class TestClient { 2 public static void main(String [] args) { 3 try { 4 String endpoint = "http://ws.apache.org:5049/axis/services/echo"; 5 Service service = new Service(); 6 Call call = (Call) service.createCall(); 7 call.setTargetEndpointAddress( new java.net.URL(endpoint) ); 8 call.setOperationName(new QName("http://soapinterop.org/", echoString")); 9 String ret = (String) call.invoke( new Object[] { "Hello!" } ); 10 System.out.println("Sent 'Hello!', got '" + ret + "'"); 11 } catch (Exception e) { 12 } } }

35 Web Services 35 Axis – using WSDLs Contains a WSDL to Java compiler Contains a Java to WSDL compiler Defines xsd to java type mapping

36 Web Services 36 Visual Studio.net Integrates Web Services into.NET Framework Framework provides... IDE.NET Framework Classes IIS web server Invocation and debugging Type definition and serialization

37 Web Services 37.NET – Creating a WS Include web service libraries Add the web service tag using System.Web; using System.Web.Services; [WebMethod] public decimal showNumber(decimal num)

38 Web Services 38.NET – Creating a WS Alternatively...

39 Web Services 39.NET – Creating a WS Build the project Automatically publishes service, WSDL and invocation page to local IIS server

40 Web Services 40.NET – Creating a client - Manual Acquire WSDL file Compile into a C# proxy class using WSDL.exe Include the proxy class and invoke methods to call web method

41 Web Services 41.NET – Creating a client - Auto Create a.NET project Add a “Web Service Reference” The proxy class is automatically created Include the proxy class and invoke its methods

42 Web Services 42 gSOAP Distributed under gSOAP and GPL licenses A toolkit for C / C++ WS development Suitable for portable / embedded devices Compiles WSDL into.h and.c Small footprint, Simple

43 Web Services 43 GSOAP – Server Side To develop a WS Create a header file for exported routines Compile with the Stub and Skeleton compiler, soapcpp2 Complete the skeleton implementation Post as a.cgi on a web server

44 Web Services 44 GSOAP – Server Side

45 Web Services 45 GSOAP – Client Side To call a WS Compile the WSDL into a header file using wsdl2h Header file contains methods that call remote WS Compile the header file into stub and skeleton files, using soapcpp2 Call stub methods to call WS methods

46 Web Services 46 GSOAP – Client Side

47 Web Services 47 WS: Ups and Downs Advantages: Interoperability across programming languages, OS and hardware Simplicity Firewall transversal Standard Extensibility Easy sniffer debugging

48 Web Services 48 WS: Ups and Downs Disadvantages: Performance – 10x slower than RMI or IIOP “Flat model” - Interface vs Object model WSDL-Human interface Data mapping is implementation depended Emerging technology

49 Web Services 49 WS: Extensions WS – Security Describes how to encode certificates and Kerberos tickets Standards to provide message integrity, confidentiality and authentication WS-MAN – Management extension Resource access, eventing and security

50 Web Services 50 Web Services DEMO


Download ppt "Web Services 1 Oren Shamir Gal Moshitch. Web Services 2 Contents The World and the Problem Historical solutions Brief history of Web Services WS: The."

Similar presentations


Ads by Google