introduction to ws

Upload: anonymous-1pdnp6xz

Post on 05-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Introduction to WS

    1/33

    Introduction to Web Services

    S.Sasirekha

  • 7/31/2019 Introduction to WS

    2/33

  • 7/31/2019 Introduction to WS

    3/33

    History Web services evolved from previous technologies

    that served the same purpose such as RPC, ORPC(DCOM, CORBA and JAVA RMI).

    Web Services were intended to solve three main

    problems:1. Interoperability

    2. Firewall traversal

    3. Complexity

  • 7/31/2019 Introduction to WS

    4/33

    Interoperability Earlier distributed systems suffered from

    interoperability issues because each vendorimplemented its own on-wire format for distributedobject messaging.

    Development of DCOM apps strictly bound to WindowsOperating system.

    Development of RMI bound to Java programminglanguage.

  • 7/31/2019 Introduction to WS

    5/33

    Firewall traversal Collaboration across corporations was an issue

    because distributed systems such as CORBA andDCOM used non-standard ports.

    Web Services use HTTP as a trans ort rotocol and

    most of the firewalls allow access though port 80(HTTP), leading to easier and dynamic collaboration.

  • 7/31/2019 Introduction to WS

    6/33

    Complexity Web Services is a developer-friendly service system.

    Most of the above-mentioned technologies such asRMI, COM, and CORBA involve a whole learning curve.

    New technologies and languages have to be learnt toimplement these services.

  • 7/31/2019 Introduction to WS

    7/33

    Distributed Component

    Technology

  • 7/31/2019 Introduction to WS

    8/33

    Web Service definition

    revisited A more precise definition:

    an application component that: Communicates via open protocols (HTTP, SMTP,

    etc.)

    Describes its messages using XML Schema

    Provides an endpoint description using WSDL

    Can be discovered using UDDI

  • 7/31/2019 Introduction to WS

    9/33

    Web Service Vs Web Application

  • 7/31/2019 Introduction to WS

    10/33

  • 7/31/2019 Introduction to WS

    11/33

    Web Services Components XML eXtensible Markup Language A uniform data

    representation and exchange mechanism.

    SOAP Simple Object Access Protocol A standardway for communication.

    UDDI Universal Description, Discovery andIntegration specification A mechanism to registerand locate WS based application.

    WSDL Web Services Description Language Astandard meta language to described the servicesoffered.

  • 7/31/2019 Introduction to WS

    12/33

    Example A simple Web Service

    A buyer (which might be a simple client) is ordering goods from aseller service.

    The buyer finds the seller service by searching the UDDI directory.

    The seller service is a Web Service whose interface is defined.

    The buyer is invoking the order method on the seller service usingSimple Object Access Protocol (SOAP) and the WSDL definition forthe seller service.

    The buyer knows what to expect in the SOAP reply messagebecause this is defined in the WSDL definition for the sellerservice.

  • 7/31/2019 Introduction to WS

    13/33

    Web Services(In Practice)

  • 7/31/2019 Introduction to WS

    14/33

    The Web Service Model The Web Services architecture is based upon the

    interactions between three roles:

    Service provider

    Service registry

    The interactions involve the:

    Publish operations

    Find operation

    Bind operations.

  • 7/31/2019 Introduction to WS

    15/33

    The Web Service Model (cont)The Web Services model follows the publish, find, and

    bindparadigm.

    1. publish 2. find

    3. bind/invoke

    Web ServiceRegistry

    Web ServiceProvider

    Web ServiceClient

  • 7/31/2019 Introduction to WS

    16/33

    Web Service Protocol Stack

  • 7/31/2019 Introduction to WS

    17/33

    XML XML stands for EXtensible Markup Language.

    XML is a markup language much like HTML.

    XML was designed to describe data.

    XML tags are not predefined. You must define yourown tags.

    The prefect choice for enabling cross-platform datacommunication in Web Services.

  • 7/31/2019 Introduction to WS

    18/33

    XML vs HTMLAn HTML example:

    John Doe

    New York

    045935435

    [email protected]

  • 7/31/2019 Introduction to WS

    19/33

    XML vs HTML This will be displayed as:

    John Doe

    2 Backroads Lane

    HTML specifies how the document is to be displayed, and notwhat information is contained in the document.

    Hard for machine to extract the embedded information.Relatively easy for human.

    [email protected]

  • 7/31/2019 Introduction to WS

    20/33

    XML vs HTML Now look at the following:

    John Doe

    2 Backroads Lane

    In this case:

    The information contained is being marked, but not fordisplaying.

    Readable by both human and machines.

    [email protected]

  • 7/31/2019 Introduction to WS

    21/33

    SOAP SOAP originally stood for "Simple Object Access Protocol" .

    Web Services expose useful functionality to Web usersthrough a standard Web protocol called SOAP.

    Soap is an XML vocabulary standard to enable programs on.

    a simple markup language for describing messagesbetween applications.

    Soap uses mainly HTTP as a transport protocol. That is,HTTP message contains a SOAP message as its payload

    section.

  • 7/31/2019 Introduction to WS

    22/33

    SOAP Characteristics SOAP has three major characteristics:

    Extensibility security and WS-routing are amongthe extensions under development.

    Neutrality - SOAP can be used over any transportrotocol such as HTTP SMTP or even TCP.

    Independent - SOAP allows for any programmingmodel .

  • 7/31/2019 Introduction to WS

    23/33

    SOAP Building BlocksA SOAP message is an ordinary XML document

    containing the following elements:

    A required Envelope element that identifies theXML document as a SOAP message.

    An o tional Header element that contains header

    information. A required Body element that contains call and

    response information.

    An optional Fault element that provides information

    about errors that occurred while processing themessage.

  • 7/31/2019 Introduction to WS

    24/33

    SOAP RequestPOST /InStock HTTP/1.1

    Host: www.stock.org

    Content-Type: application/soap+xml; charset=utf-8 Content-Length: 150

    IBM

  • 7/31/2019 Introduction to WS

    25/33

    SOAP ResponseHTTP/1.1 200 OK

    Content-Type: application/soap; charset=utf-8

    Content-Length: 126

    34.5

  • 7/31/2019 Introduction to WS

    26/33

    SOAP Security SOAP uses HTTP as a transport protocol and hence

    can use HTTP security mainly HTTP over SSL.

    But, since SOAP can run over a number of applicationrotocols such as SMTP securit had to be

    considered.

    The WS-Security specification defines a completeencryption system.

  • 7/31/2019 Introduction to WS

    27/33

    WSDL WSDL stands for Web Services Description Language.

    WSDL is an XML vocabulary for describing Web services. It

    allows developers to describe Web Services and theircapabilities, in a standard manner.

    spec es w a a reques message mus con a n an

    what the response message will look like in unambiguousnotation. In other words, it is a contract between the XMLWeb service and the client who wishes to use this service.

    In addition to describing message contents, WSDL defineswhere the service is available and what communications

    protocol is used to talk to the service.

  • 7/31/2019 Introduction to WS

    28/33

    The WSDL Document Structure A WSDL document is just a simple XML document.

    It defines a web service using these major elements: port type - The operations performed by the web

    service. -

    service. types - The data types used by the web service. binding - The communication protocols used by

    the web service.

  • 7/31/2019 Introduction to WS

    29/33

    WSDL Document

  • 7/31/2019 Introduction to WS

    30/33

    UDDI UDDI stands for Universal Description, Discovery

    and Integration.

    UDDI is a directory for storing information aboutweb services like ellow a es.

    UDDI is a directory of web service interfacesdescribed by WSDL.

  • 7/31/2019 Introduction to WS

    31/33

  • 7/31/2019 Introduction to WS

    32/33

    Yes

    Yes

  • 7/31/2019 Introduction to WS

    33/33