Docstoc

Web Services Overview

Document Sample
Web Services Overview Powered By Docstoc
					Web Services
 Overview


               1
    Agenda
●   Evolution of network computing
●   What is Web Services?
●   Why Web Services?
●   Where is Web Services?
●   Web Services Architecture
●   Web Services Standards
●   Java™ APIs for Web Services
●   J2EE as platform of choice for Web Services
●   Web Services Tools
●   Roadmap and Summary
                                                  4
   Evolution of
Network Computing


                    5
  What is
Web Services?


                6
             The New Software
                                  Payment
Developer   X1
                      Locater                X106

                                    New             User‟s
     X106                          Service          Device

                      Calendar
                                Authentication


        Shrink Wrap    Software-as-a-Service
            Simple WS Metaphors

●   A WS is text-messaging between systems
    instead of humans

●   Systems can‟t understand free-form text
    messages like humans can

●   So, all WS messages must conform to a
    defined structure (protocol)


                                              8
                Simple WS Metaphors

●   Other distributed protocols are typically binary
    (RMI-IIOP), this severely complicates
    interoperability
       How can a COBOL program „talk to‟ a Java program


●   The simplest protocol is text-based
    (ASCII/Unicode)

●   XML is the ideal choice for specifying text-
    based WS protocols

                                                           9
            Simple WS Metaphors

●   How do WS clients „google‟ WS providers?

●   How does a WS client „surf‟ to a WS server of
    interest?




                                                10
(Simplified) Web Service
Architecture


                        Registry

1. Service Registers                     2. Client Request
                                           Service Location
     PUBLISH
                                                FIND
                       3. Client calls
                           Service
      Web                   BIND
                                              Service
     Service                                   Client
                                                              11
Web Services Definition by W3C
●   A Web service is a software application
●   identified by a URI,
●   whose interfaces and binding are
    capable of being defined, described and
    discovered by XML artifacts and
●   supports direct interactions with other
    software applications
●   using XML based messages
●   via internet-based protocols
                                              12
Distributed Computing
Evolution

     Servers        Servers




       Clients                                   PDA      Cell
                          Internet
                                                          Phone

     Client-
Server(C/S) silos
                                 Clients   Workstation      Server
                    Web-based
                    computing                   Kiosk      Laptop


                                            Web Services/Peer-to-
                                                   Peer        13
Traditional C/S vs. Web Services

     Traditional C/S             Web Service
 ●   Within enterprise       ●   Between enterprises
 ●   Tied to a set of        ●   Program language
     programming languages       independent
 ●   Procedural              ●   Message-driven
 ●   Usually bound to a      ●   Easily bound to different
     particular transport        transports
 ●   Tightly-coupled         ●   Loosely-coupled
 ●   Efficient processing    ●   Relatively not efficient
     (space/time)                processing


                                                             14
Web Application vs. Web Services

   Web Application                 Web Service

   ●   User-to-program         ●   Program-to-program
       interaction                 interaction
   ●   Static integration of   ●   Possibility of dynamic
       components                  integration of
   ●   Monolithic service          components (in the
                                   future)
                               ●   Possibility of service
                                   aggregation (in the
                                   future)

                                                            15
Characteristics of Web
Services
●   XML based everywhere
●   Message-based
●   Programming language independent
●   Could be dynamically located
●   Could be dynamically assembled or
    aggregated
●   Accessed over the internet
●   Loosely coupled
●   Based on industry standards
                                        16
Web Services
                                     The Service Grid
  Service     Service registration
  Registry



                      Service
   Service
                    invocation             Service
  discovery                                delivery




                                                      17
Service                                                        Nasdaq
Aggregation                                                   Input: Symbol
                                                              Output: Price



                                                          News feed 1
                   Stock Service                            Input: Symbol
                                                          Output: News links
                      Portal
User                  Input: Symbol
                   Output: Price, News,
                               Trade

                                                          News feed n
                                                            Input: Symbol
                                                          Output: News links



  Brokerage 1                             Brokerage n
 Input: Symbol, Price,                Input: Symbol, Price,
            Qty                                  Qty


                                                                               18
Why Web Services?


                    19
Why Web Services?
                    Web Services:
                    ●   Are platform neutral
                    ●   Are accessible in a
                        standard way
                    ●   Are accessible in an
                        interoperable way
                    ●   Use simple and
                        ubiquitous plumbing
                    ●   Are relatively cheap
                    ●   Simplify enterprise
                        integration

                                          20
Why Web Services?
●   Interoperable – Connect across heterogeneous
    networks using ubiquitous web-based standards
●   Economical – Recycle components, no
    installation and tight integration of software
●   Automatic – No human intervention required
    even for highly complex transactions
●   Accessible – Legacy assets & internal apps are
    exposed and accessible on the web
●   Available – Services on any device, anywhere,
    anytime
●   Scalable – No limits on scope of applications and
                                                    21
Web Services Usage Example
                    Distributor


                            XML

              XML
                                         Manufacturing
  Supplier           Internet               Facility
                                   XML

                    XML


                     Logistics


“Growing need for a standard lightweight infrastructure
    for data exchange in e-business applications.”
                                                         22
Impact of Web Services on Software:
“Application Dis-Integration”
                           Web Services

     Monolithic        App       App       App
     Software         Service   Service   Service

      Application

    System Software   System    System    System
                      Service   Service   Service

      A Computer

                           The Network


                                                    23
Macro web services – Virtual
Systems
                                             Web Services
 A web service is
 accessed                                    Bank Balance
 programmatically by
 applications or other
 web services                 Net worth        Stock Position

                                               Insurance
                  Portfolio                    Cash Value

                              Stock ticker
                                                 Biz News
“Portfolio” can be an           News
application, a portal
channel, or a web                             World News
service itself                                                  24
Micro web services – Virtual Apps
A web service is                       Web Services
accessed
programmatically by                    Bank
                                       Spellbalance
                                             Check
applications or other
web services              Grammar          Dictionary

                                         Thesaurus
        Word Processing

                            Media
“Word processing”                            c:\...
can be an                 Publishing
application, a
capability, or a web                       http://...
service itself                                          25
Three Laws of Computing

●   Moore's Law
       Computing power doubles every 18 months
●   Gilder's Law
       Network bandwidth capacity doubles every 12
        months
●   Metcalfe's Law (Net Effect)
       Value of network increases exponentially as
        number of participants increases

                                                      26
    Impact on Integration:
    Trigger the Network Effect


  Custom
Integration                             Web Services




     Metcalfe‟s Law: The value of the network is
     proportional to the square of the number of       27
Myth: Web Services is a New
Concept
●   Web services is distributed computing all
    over again – only now it is based on the web
                      Distributed Computing ala CORBA /
       Concept        Java                                    Basic Web Services
Interface Description CORBA IDL, Java interface               WSDL
RPC support           ORBs, Idl2java compilers, rmic          SOAP, compilers for WSDL
Service Registry      CORBA naming service, JNDI              UDDI
Messaging support CORBA Event/Notification service, JMS       ?
Transaction support CORBA Transaction service, JTS            ?
Secuity support       CORBA Security service, Java security   ?



                                                                                     28
Other Popular Myths
Surrounding Web Services
●   Web services require only SOAP, WSDL,
    UDDI: We need more high-level semantics
●   Web services are based on the RPC
    paradigm: Document-driven model would
    be more popular communication model
●   Web services must be based on HTTP:
    Other transports such as SMTP can be
    also used

                                              29
     Where is &
Where is Web Services
       going?


                        30
Myths about Web Services
●   Web Services cure cancer: Not for a
    very very long time!
●   Web Services are something
    completely new: Not True!
●   You have to write Web Services
    from scratch: Not True!
●   J2EE Platform does not support
    web services: Not True!
                                      31
State of Web Services
●   Technology/Standards are still evolving
       SOAP, WSDL, UDDI are not enough
●   Business web services is the next big
    thing, but more works are needed in
       Quality of Service, management
       Security, transaction, state and user context
       Work flow, Identity management,
       Provisioning, Accounting
●   Will be adopted in phases
                                                        32
Web Services Adoption Phases
●   1st phase (current state)
       Concerted deployment internally within an
        organization mainly for interoperability
       SOAP over HTTP/S
●   2nd phase (1 to 2 years)
       Selective and non-aggregate deployment with
        trusted outside business partners
       Private registry deployment
●   3rd phase (at least 3 to 4 years away)
       Wider, more dynamic and aggregate deployment
        with outside business partners
       Public registry deployment                     33
Business Web Services (B2B)
Architectural Components (ebXML)

●   B2B collaboration
●   Secure and reliable message
    delivery
●   Non-repudiation
●   Partner profile
●   Repository for business data objects
                                           34
                 B2B Collaboration


    Simple Web             B2B Collaboration
     Services
   Simple interaction        Complex interaction
   Consumer oriented         Business oriented
   Short-living process      Long-running process
   No business               Supports business
    collaboration              collaboration
   No partner profile        Supports partner
   Not secure, not            profile
    reliable                  Secure and reliable
   Does not support           and non-repudiation
    non-repudiation           Supports non-
   No repository              repudiation
    support                   Registry and
                                                      35
Trends Towards Service Orientation
●   Evolution of EAI to web service standards
●   XML RPC => Asynchronous XML Messaging
●   Towards de-centralization
●   Componentized services
     Composable and composite services
     Data encapsulated within component
     Data ownership follows component ownership
●   Brokered web services
●   Flexible relationships => Adaptive businesses
                                                   36
Simple Web Services Architectural
Components (WUS)


●   Service Description
●   Service Registration (Publication)
    and Discovery
●   Service Invocation


                                         37
Core Web Services
   Standards


                    38
(Simplified) Web Service
Architecture


                        Registry

1. Service Registers                     2. Client Request
                                           Service Location
     PUBLISH
                                                FIND
                       3. Client calls
                           Service
      Web                   BIND
                                              Service
     Service                                   Client
                                                              39
     SOAP
 (Simple Object
Access Protocol)
                   40
SOAP
●   Simple Object Access Protocol
●   Wire protocol similar to
       IIOP for CORBA
       JRMP for RMI
●   XML is used for data encoding
       “text” based protocol vs. “binary” protocol
●   Supports XML-based RPC

                                                      41
What SOAP is Not
●   Not a component model
       So it will not replace objects and
        components, i.e. EJB, JavaBeans
●   Not a programming language
       So it will not replace Java
●   Not a solution for all
       So it will not replace other distributed
        computing technologies such as RMI
                                                   42
What does SOAP Define?
●   Message Envelope
●   Encoding Rules
●   RPC Convention
●   Binding with underlying protocols




                                        43
SOAP Message Format
 SOAP Message        SOAP Envelope

                     SOAP Header
 Primary MIME part    Header Entry
       (text/xml)

                      Header Entry
    Attachment
                      SOAP Body
    Attachment
                       Body Entry


                       Body Entry
    Attachment


                                     44
SOAP Message Envelope
●   Encoding information
●   Header
       Optional
       Could contain context knowledge
         ●   Security
         ●   Transaction

●   Body
       RPC methods and parameters
       Contains application data
                                          45
SOAP Encoding
• Rules of expressing application-defined
  data types in XML
• Based on W3C XML Schema
• Simple values
  – Built-in types from XML Schema, Part 2
    (simple types, enumerations, arrays of
    bytes)
• Compound values
  – Structs, arrays, complex types
                                             46
SOAP RPC Request Example
<SOAP-ENV:Envelope
   xmlns:SOAP-ENV="…"
   SOAP-ENV:encodingStyle="…">
  <SOAP-ENV:Header>
    <!-- Optional context information -->
  </SOAP-ENV:Header>

  <SOAP-ENV:Body>
    <m:GetLastTradePrice xmlns:m=“some_URI">
       <tickerSymbol>SUNW</tickerSymbol>
    </m:GetLastTradePrice>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
                                               47
SOAP RPC Response Example
<SOAP-ENV:Envelope
   xmlns:SOAP-ENV="…"
   SOAP-ENV:encodingStyle="…">
  <SOAP-ENV:Header>
     <!-- Optional context information -->
  </SOAP-ENV:Header>

  <SOAP-ENV:Body>
   <m:GetLastTradePriceResponse xmlns:m=“some_URI">
      <price>30.5</price>
   </m:GetLastTradePriceResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
                                                      48
SOAP RPC
●   Information needed for a method call:
       The URI of the target object


        <SOAP-ENV:Body>
           <m:GetLastTradePrice
            xmlns:m=“http://stocks.com/StockQuotes">
               <tickerSymbol>SUNW</tickerSymbol>
           </m:GetLastTradePrice>
        </SOAP-ENV:Body>



                                                       49
SOAP RPC
●   Information needed for a method call:
       The URI of the target object
       Method name


        <SOAP-ENV:Body>
           <m:GetLastTradePrice
            xmlns:m=“http://stocks.com/StockQuotes">
               <tickerSymbol>SUNW</tickerSymbol>
           </m:GetLastTradePrice>
        </SOAP-ENV:Body>



                                                       50
SOAP RPC
●   Information needed for a method call:
       The URI of the target object
       Method name
       Parameters
        <SOAP-ENV:Body>
           <m:GetLastTradePrice
            xmlns:m=“http://stocks.com/StockQuotes">
               <tickerSymbol>SUNW</tickerSymbol>
           </m:GetLastTradePrice>
        </SOAP-ENV:Body>



                                                       51
Quick WSDL Tutorial

                      52
What is WSDL?
• XML language for describing web services
• Web service is described as
  – A set of communication endpoints (ports)
• Endpoint is made of two parts
  – Abstract definitions of operations and messages
  – Concrete binding to networking protocol (and
    corresponding endpoint address) and message
    format
• Why this separation?
  – Enhance reusability (as we will see in UDDI
    reference to WSDL document)                       53
Why WSDL?
• Enables automation of communication
  details between communicating partners
  – Machines can read WSDL
  – Machines can invoke a service defined in
    WSDL
• Discoverable through registry
• Arbitration
  – 3rd party can verify if communication conforms
    to WSDL
                                                54
WSDL Document Example
●   Simple service providing stock quotes
●   A single operation called
    GetLastTradePrice
●   Deployed using SOAP 1.1 over HTTP
●   Request takes a ticker symbol of type
    string
●   Response returns price as a float
                                            55
WSDL Elements
●   Types
●   Message
●   Operation
●   Port Type
●   Binding
●   Port
●   Service
                56
WSDL Elements
●   Types
       Data type definitions
       Used to describe exchanged messages
       Uses W3C XML Schema as canonical type
        system




                                            57
WSDL Example: Types
<definitions name="StockQuote"
   targetNamespace="http://example.com/stockquote.wsdl"
              xmlns:tns="http://example.com/stockquote.wsdl"
              xmlns:xsd1="http://example.com/stockquote.xsd"
              xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
              xmlns="http://schemas.xmlsoap.org/wsdl/”>
   <types>
       <schema targetNamespace="http://example.com/stockquote.xsd"
               xmlns="http://www.w3.org/2000/10/XMLSchema">
            <element name="TradePriceRequest">
               <complexType>
                   <all>
                       <element name=”tickerSymbol" type="string"/>
                   </all>
               </complexType>
            </element>
            <element name="TradePrice">
               <complexType>
                   <all>
                       <element name="price" type="float"/>
                   </all>
               </complexType>
            </element>
       </schema>
   </types>
                                                                      58
WSDL Elements
●   Messages
       Abstract, typed definitions of data being
        exchanged
●   Operations
       Abstract description of an action
       Refers to an input and/or output messages
●   Port type
       Collection of operations
       Abstract definition of a service

                                                    59
Example:
Messages, Operation, Port type
<message name="GetLastTradePriceInput">
    <part name="body" element="xsd1:TradePriceRequest"/>
</message>

<message name="GetLastTradePriceOutput">
    <part name="body" element="xsd1:TradePrice"/>
</message>

<portType name="StockQuotePortType">
    <operation name="GetLastTradePrice">
       <input message="tns:GetLastTradePriceInput"/>
       <output message="tns:GetLastTradePriceOutput"/>
    </operation>
    <!-- More operations -->
</portType>
                                                     60
WSDL Elements
●   Binding
       Concrete protocol and data format for a
        particular Port type
       Protocol example: SOAP 1.1 over HTTP or
        SOAP 1.1 over SMTP
●   Port
       Defines a single communication endpoint
       Endpoint address for binding
       URL for HTTP, email address for SMTP
●   Service
       Aggregate set of related ports            61
Example: Binding, Port, Service
<binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">
   <soap:binding style="document"
         transport="http://schemas.xmlsoap.org/soap/http"/>
   <operation name="GetLastTradePrice">
      <soap:operation
            soapAction="http://example.com/GetLastTradePrice"/>
        <input> <soap:body use="literal" />
        </input>
        <output> <soap:body use="literal" />
        </output>
   </operation>
</binding>

<service name="StockQuoteService">
   <documentation>My first service</documentation>
   <port name="StockQuotePort" binding="tns:StockQuoteBinding">
       <soap:address location="http://example.com/stockquote"/>
   </port>
</service>


                                                                       62
UDDI


       63
Service Architecture

                         UDDI
                         Registry
                                          2. Client Request
 1. Service Registers                       Service Location
      PUBLISH                                    FIND



       Web                                     Service
                        3. Client calls
      Service                Service            Client
                            BIND

UDDI defines a way to publish and find
information about Web services.
                                                               64
UDDI (Universal Description,
Discovery and Integration)
●   “White pages”
    – address, contact, and known identifiers
●   “Yellow pages”
    – industrial categorizations
        ●   Industry: NAICS (Industry codes - US Govt.)
        ●   Product/Services: UN/SPSC (ECMA)
        ●   Location: Geographical taxonomy
●   “Green pages”
    – technical information about services
                                                          65
   Other
Web Services
 Standards

               66
ebXML




A global electronic market place where
enterprises of any size, anywhere can:
 – Find each other electronically
 – Conduct business through exchange of XML
  based business messages
                                         67
More Web Services Standards
●   Security
       XML Signature, XML Encryption, XKMS, XACML,
        SAML, Liberty, WS-Security
●   Transaction
       BTP, WS-Transaction
●   Business collaboration and choreography
       ebXML BPSS, ebXML CPP/CPA, BPML, WSFL,
        XLANG, WSCI, BPEL4WS


                                                 68
More Web Services Standards
●   Business Language
       UBL (Universal Business Language)
●   Component model
       WSIA (Web Services for Interactive
        Application)
●   Portal
       WSRP (Web Services for Remote Portals)


                                                 69
    Java APIs
for Web Services
                   70
Java APIs for SOAP, WSDL,
UDDI
●   SOAP Messaging
       JAXM (JSR 67), SAAJ, JAX-RPC (JSR
        101), JMS
●   WSDL
       Java API for WSDL (JSR 110)
       JAX-RPC (JSR 101)
●   UDDI
       JAXR (JSR 67)
                                            71
Java APIs for ebXML
●   ebXML Message Service (TR&P)
       JAXM (JSR 67) with ebXML Message Service
        profile
●   ebXML Registry/Repository
       JAXR (JSR 93)
●   CPP/CPA
       Java API for ebXML CPP/CPA (JSR 157)


                                               72
J2EE Web Services Framework
●   J2EE 1.4 (JSR 151)
●   Web services for J2EE (JSR 109)
●   JAX-RPC (JSR 101)
●   JAXR
●   SAAJ
●   EJB 2.1

                                      73
Java APIs for XML
Document Management
●   JAXP (Java API for XML processing, JSR
    05)
       Assembly language for XML document
        processing
●   JAXB (Java API for XML data-binding, JSR
    31)
       Higher level language for XML document
        processing
●   Streaming API for XML (JSR 173)              74
Java APIs for XML Security
●   XML Digital Signature (JSR 105)
●   XML Encryption (JSR 106)
●   XML Trust Service (JSR 104)
●   Secure Assertion Markup Language
    (SAML, JSR 155)
●   WS-Security (JSR 183)

                                       75
More Java APIs for Web
Services
●   XML Transactioning API for Java (JSR
    156)
       Java API for OASIS BTP
●   Web Services for J2ME (JSR 172)
       SOAP messaging for J2ME devices
●   Web Services Metadata for J2EE (JSR
    181)
       Metadata based Web services
                                          76
Web Services Framework
       for J2EE


                         77
J2EE Platform& Web Services
    B2B
 Applications

                                       Existing
    B2C                              Applications
 Applications



    Web
  Services
                Application Server
  Wireless                             Enterprise
                                      Information
 Applications
                                        Systems

                                                    78
Why J2EE for Web Services?
●   Web services is just one of many
    service delivery channels of J2EE
       No architectural change is needed
       Existing J2EE components can be easily
        exposed as Web services
●   Many benefits of J2EE are
    preserved for Web services
       Portability, Scalability, Reliability
       No single-vendor lock-in                 79
Where Are We Now?
●   Java APIs for Web Services are
    being developed very rapidly
●   Tools are available now for
    exposing existing J2EE
    components as Web services
●   J2EE community has defined
    overall framework for Web Services
    (J2EE 1.4, JSR 109)
                                     80
Design Goals J2EE Web Services
Framework
●   Portability of Web services component
       Over different vendor platform
       Over different operational environment
●   Leveraging existing J2EE programming
    models for service implementation
●   Easy to program and deploy
       High-level Java APIs
       Use existing deployment model
                                                 81
J2EE Web Services Framework
●   J2EE 1.4
       Umbrella framework for Web services
       JSR 109, JAX-RPC, JAXR, EJB 2.1, Servlet
        2.4,
●   JAX-RPC
       Defines client programming model
       Defines Servlet-based Web services endpoint
        model

                                                   82
J2EE Web Services Framework

●   EJB 2.1
       Defines Stateless Session Bean-based Web
        services endpoint model
●   Servlet 2.4
       Will be aligned with JAX-RPC
●   JSR 109
       Defines standard Web services packaging and
        deployment model
                                                   83
Web Services Architecture
      over J2EE

                      84
What Is a Web Service?
●   A set of endpoints (ports) operating on
    messages
●   Ports are operating within a container
        Container provides runtime environment
        Contract for runtime environment are specified in
         JAX-RPC, EJB 2.1, JSR 109
●   Service is described in WSDL document
    and published to a registry
        WSDL specifies a contract between service
         provider and client
                                                         85
Web Service Component
and Container
●   Container vs. Component model
       Web services components get executed within a
        container
       Components are portable (under J2EE 1.4)
●   Web service components
       Web-tier (Servlet-based endpoint)
       EJB-tier (Stateless session bean-based endpoint)

                                                     86
Web Service Components
                                Web services
                                components




               Source: Web Services for J2EE (JSR 109), V1.0   87
Java Technology-based
  Web Services Tools



                        88
Web Services Tools for Java
Platform
●   Web Services Tools (Available Now!)
       Tools that come with reference implementations of
        Java APIs for Web services (JAX-RPC RI)
       Systinet (Idoox), Iopsys, Cape Clear, Apach SOAP
●   IDE's (Now!)
       Sun Java Enterprise Studio 7
       JBuilder™ from Borland
       JDeveloper™ from Oracle
       WebGain™ from WebGain
                                                            89
J2EE 1.4
●   Focus is Web services
       Umbrella JSR for all Java APIs for Web
        services
         ●   JSR 109, JAX-RPC, JAXR, EJB 2.1
       Web services framework for J2EE
       J2EE component model, deployment,
        packaging, and container requirements
●   Released in Nov. 2003
       http://java.sun.com/j2ee/1.4/download-
        dr.html
                                                 90
J2EE 1.4 SDK
●   Web services APIs are well integrated
●   Contains
       JAXP, SAAJ, JAX-RPC, JAXR
       Sun Java App Server PE 8
       Extensive tutorial




                                            91
Summary



          92
Summary
●   Web services provides a new paradigm for
    program to program communication
●   Comprehensive set of Java APIs for Web
    Services are now available!
●   J2EE is the platform of choice for Web
    services




                                               93
Passion!



           94

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:10
posted:7/18/2011
language:English
pages:92