Docstoc

XML

Document Sample
XML Powered By Docstoc
					sblim@konkuk.ac.kr
          임상범




                     1
   공지사항 및 수업관련 내용 안내
    ◦ http://117.16.146.89/classes/WebServices08/Web
      Services_08.htm

   수업 진행에 필요한 사항들
    ◦ 프로그래밍 언어 : Java
    ◦ 관련 서비스 : Apache, Tomcat, JSP, Servlet, IIS, ASP,
      My-SQL, MS-SQL

   Feedback
    ◦ DO NOT WAIT until end of semester.


                                                         2
   휴강: 3월 10일
   보강: 3월 14일, 17일 한 시간씩 연장 수업




                                  3
   Key elements of Web Services
    ◦   XML
    ◦   SOAP
                            Registry
    ◦   WSDL
    ◦   UDDI



                 Consumer               Provider


            You need to remember this picture.

                                                   4
             Distributed System: Definition
   A distributed system is a collection of independent computers that
             appears to its users as a single coherent system
Two aspects:
(1) hardware - autonomous computers
(2) software – users think they are dealing with a single system
         Goals of Distributed Systems

•   Allow users to access and share resources
•   Transparency
    - To hide the fact that its processes and resources are
        physically distributed across multiple computers
•   Openness
    -   To offer services according to standard rules that
        describe the syntax and semantics of those services
    -   E.g., specify interfaces using an interface definition
        language (IDL)
•   Scalability
              Openness of Distributed Systems
Open distributed system: Be able to interact with services from other
open systems, irrespective of the underlying environment:
   • Systems should conform to well-defined interfaces
   • Systems should support portability of applications
   • Systems should easily interoperate


Achieving openness: At least make the distributed system independent
from heterogeneity of the underlying environment:
   • Hardware
   • Platforms
   • Languages
   Stand alone System
   Distributed computing
    ◦ a method of computer processing in which different
      parts of a program run simultaneously on two or
      more computers that are communicating with each
      other over a network. Distributed computing is a
      type of segmented or parallel computing.
   Parallel computing
    ◦ processing in which different parts of a program
      run simultaneously on two or more processors that
      are part of the same computer.



                                                           8
   Both types of processing require that a program be se
    gmented—divided into sections that can run simultan
    eously.
    ◦ distributed computing also requires that the division of the
      program take into account the different environments on w
      hich the different sections of the program will be running.
    ◦ For example, two computers are likely to have different file
      systems and different hardware components.
   Distributed computing is a natural result of using net
    works to enable computers to communicate efficientl
    y.
    ◦ But distributed computing is distinct from computer networ
      king or fragmented computing. T
    ◦ he latter refers to two or more computers interacting with e
      ach other, but not, typically, sharing the processing of a sin
      gle program.
    ◦ The World Wide Web is an example of a network, but not an
      example of distributed computing.

                                                                       9
Architectures for Distributed programming
 ◦ Client-server — Smart client code contacts the server for
   data, then formats and displays it to the user. Input at th
   e client is committed back to the server when it represent
   s a permanent change.
 ◦ 3-tier architecture — Three tier systems move the client i
   ntelligence to a middle tier so that stateless clients can b
   e used. This simplifies application deployment. Most web
   applications are 3-Tier.
 ◦ Tightly coupled (clustered) — refers typically to a set of hi
   ghly integrated machines that run the same process in pa
   rallel, subdividing the task in parts that are made individu
   ally by each one, and then put back together to make the
   final result.
 ◦ Peer-to-peer — an architecture where there is no special
   machine or machines that provide a service or manage th
   e network resources. Instead all responsibilities are unifo
   rmly divided among all machines, known as peers. Peers
   can serve both as clients and servers.
                                                                   10
           Client–Server Model

• Basic model
• Application layering
• Client–Server architectures
            Basic Client–Server Model (1/2)

Characteristics:
• There are processes offering services (servers)
• There are processes that use services (clients)
• Clients and servers can be distributed across different machines
• Clients follow request/reply model with respect to using services
             Basic Client–Server Model (2/2)
Servers: Generally provide services related to a shared resource:
• Servers for file systems, databases, implementation repositories, etc.
• Servers for shared, linked documents (Web, VoD)
• Servers for shared applications
• Servers for shared distributed objects
Clients: Allow remote service access:
• Programming interface transforming client‟s local service calls to
request/reply messages
• Devices with (relatively simple) digital components (barcode readers,
teller machines, hand-held phones)
• Computers providing independent user interfaces for specific services
• Computers providing an integrated user interface for related services
(compound documents)
                Application Layering (1/2)
Traditional three-layered view:
• User-interface layer contains units for an application‟s user interface
• Processing layer contains the functions of an application, i.e. without
specific data
• Data layer contains the data that a client wants to manipulate through
the application components

Observation: This layering is found in many distributed information
systems, using traditional database technology and accompanying
applications.
Application Layering (2/2)
              Client-Server Architectures

Single-tiered: dumb terminal/mainframe configuration
Two-tiered: client/single server configuration
Three-tiered: each layer on separate machine
Traditional two-tiered configurations:
17
   Distributed computing protocols
    ◦ OMG (Object Management Group)의 CORBA
    ◦ Microsoft의 DCOM
    ◦ Sun의 RMI
   RPC (Remote Procedure Call):
    ◦ Client and application program call remote procedure in different
      computer by using above protocols.
   connection-oriented
    ◦ Client make connection with server and execute server side procedures
    ◦ During maintain connection, server waiting for request from client and
      return results when request is made.


                             Need
                             connection
       Remote Client                              Remote server

                             Request for remote
            Application      method
                                                      Remote
            Program          Return resulta           Procedure

                                                                               18
   1. Maintain connection
    ◦ Can not properly handle situation when client/server
      connection has been lost
   2. Waste Resources
    ◦ Connected clients with un-active status will hold valuable
      resources (memory, connection)
   3. Firewall
    ◦ Most of time connection oriented protocols can not go
      through firewalls. Especially security is very critical these
      days.
   4. Comparability
    ◦ All uses different protocols. Lack of comparability between
      different protocols. They can communicates each other only
      if they uses same protocol.
    ◦ Ex: RMI client only can connect to a server that has RMI
      protocol on it.
                                                                      19
   A computer systems architectural style
    ◦ for creating and using business processes,
      packaged as services.
   SOA also defines and provisions the IT
    infrastructure to allow different applications
    to exchange data and participate in business
    processes.
   These functions are loosely coupled with the
    operating systems and programming
    languages underlying the applications.


                                                     20
   SOA separates functions into distinct units
    (services), which can be distributed over a
    network and can be combined and reused to
    create business applications.
   These services communicate with each other
    by passing data from one service to another,
    or by coordinating an activity between two or
    more services.




                                                    21
   I like to build new “housing find services
    (http://www.housingmaps.com/)” using “google
    map” and “Housing information (text based)”
    system.
   What we should do?
    ◦ We already have “google map (http://maps.google.com/)”
    ◦ Housing Information
      (http://www.craigslist.org/about/sites.html)”




                                                               22
   Using existing two applications we like to
    make new application like this.




                                                 23
   Required the developers from Housing Maps
    to have close ties with both Google and
    Craigslist to figure out how to build, integrate
    and manage the three applications.
   The coordination of technologies, versions
    and processes to build and keep the
    composite application working would have
    been hard if not impossible.
   What happen if Google or Craigslist change or
    upgrade their system?


                                                       24
• By using standard
interface, It is easy to
integrate two different
services.
• Even Google and
Craigslist change or
upgrade their system,
it will not change any
services.
• Technologies like
                           Standard Interface   Standard Interface
XML, Web services,
and others make this         Google Map
                                                     Housing
                                                   Information
possible.                      Service                Service

                                                                     25
26
   Key elements of Web Services
    ◦   XML
    ◦   SOAP
                            Registry
    ◦   WSDL
    ◦   UDDI



                 Consumer               Provider


            You need to remember this picture.

                                                   27
   Information on a website is intended for
    humans.
   Information which is avaliable through a Web
    Services will always be accessed by software,
    never directly by a human.
   Even though Web Services rely heavily on
    existing Web technologies (such as HTTP),
    they have no relation to web browsers and
    HTML.



                                                    28
UDDI Spec.                            UDDI Spec.

                    Registry




             Find                Publish




Consumer                         Provider
                          Bind


                WSDL Spec.
                SOAP Spec.
                                                   29
   UDDI: Universal Description, Discovery and
    Integration
    ◦ a platform-independent, XML-based registry for businesses
      worldwide to list themselves on the Internet.
    ◦ an open industry initiative, sponsored by OASIS, enabling
      businesses to publish service listings and discover each
      other and define how the services or software applications
      interact over the Internet.
   WSDL: Web Service Description Language
    ◦ an XML-based service description on how to communicate u
      sing web service.
    ◦ The WSDL defines services as collections of network endpoin
      ts, or ports. WSDL specification provides an XML format for d
      ocuments for this purpose.
   SOAP: Simple Object Access Protocol
    ◦ a protocol for exchanging XML-based messages over
      computer networks, normally using HTTP.
    ◦ SOAP forms the foundation layer of the Web services stack,
      providing a basic messaging framework that more abstract
      layers can build on.                                            30
                      UDDI Registry



2. Get WSDL URL                                1. Publish service description
                                               and WSDL URL
                      3. Request WSDL
                                          WSDL

                          4. Send WSDL                 Web Service System
Java, VB, C++, C#
                                                             Remote Procedure
Application Program     5. Call Remote Procedure
                        SOAP Message                         Remote Procedure


                          6. Return result in SOAP message



                                                                                31
   To put it quit simply, they are yet another
    distributed computing technology (like CORBA, RMI,
    EJB, etc).
   They allow us to create client/server applications.
    ◦ Example:
    ◦ Problem: keep a database with up-to-date information
      about weather in the USA, and I want to distribute that
      information to anyone in the world.
    ◦ Solution: To do so, I could publish the weather information
      through a Web service that, given a ZIP code, will provide
      the weather information for that ZIP code.

                 Service request:
                 Get weather information   Server
                 for ZIP code 12345
                   INTERNET                     Web
    Client
                                                Service
                 Service response:
                 Cloudy with a chance of
                 meatballs
                                                                    32
   We can do previous example with RMI, CORBA, EJB, and
    countless other technologies!!
   Web Services are platform-independent and language-
    independent, since they use standard XML languages.
    ◦ This means that our client program can be developed in C++ and
      running under Windows, while the Web service is programmed in
      Java and running under Linux.
   Most Web Services use HTTP for transmitting messages (such
    as the service request and response).
    ◦ This is major advantage if you want to build an Internet-scale
      application, since most of the Internet‟s proxies and firewalls
      won‟t mess with HTTP traffic.
   They lend themselves naturally to build loosely coupled
    systems. These types of systems are more scalable than
    strongly coupled systems, and impose fewer architectural
    requirements on the actual implementation of the Web
    services.
    ◦ Suffice it to say that the reason why Web Services are ideal to
      build loosely coupled systems is because they are message-
      oriented and rely on language-neutral XML dialects to send
      messages, to specify interfaces, etc.
                                                                        33
   Overhead. Transmitting all your data in XML is
    obviously not as efficient as using a proprietary
    binary code. What you win in portability, you lose
    in efficiency. Even so, this overhead is usually
    acceptable for most applications, but you will
    probably never find a critical real-time application
    that uses Web Services.
   Lack of maturity. Web Services are relatively new
    and, although the core specifications tat deal with
    fundamental languages (XML, WSDL, …) and
    protocols (HTTP, SOAP, …) are pretty stable, the
    world of Web Services is still evolving at a fast pace.
    Standards dealing with more advanced capabilities
    expected from distributed systems, such as
    transactions, security, etc. are either very new or
    still in the work.                                        34
                                                     Server A
                          Where can I find a
                 (1)      “weather service”?              Discovery
                                                          Service
      We finally know There‟s a Web
A client may have no where the “weather service” (2)
      Service is locatedIn and how
knowledge of what Web server Bto
      invoke it. The invocation itself
service it is going to                                The discovery service
      is So, our a language called
invoke. done in first will                         The Web service will us
                                                        Server B
                                                      will reply, telling
                             How first
be to SOAP. Therefore, we will exactly should I kindly reply with a SOAP
       discover a Web                                 what services can
                   (3)
    Client a meetsrequest asking for
                             invoke you?
Service that SOAP our
      send                                         response which includes
                                                      provide us the service
                                                   thewe
                                                       forecast we
requirements. theforecast of a Web service, but we require. asked
      the weather location of a
We now know
                                                        (4)
                           Take a look at this: WSDL or maybe an error
have certain cityhow to actually invoke it. Sure,for,
      no idea of                                    we
                                                   message is our
know it can give me the forecast for a US city, but how Web SOAP
                           SOAP request
                                                   request was incorrect.
                                                             Service
do we perform the actual service invocation? The The Web Service replies
                           Invoke getweatherInfo()
method I have to(5) invoke might be called “string in a language called
                           With parameter „12345‟
getCityPostalCode(int CityPostalCode)”, but it could  WSDL.
also be called “sring getUSCityWeather(string citName,
                           SOAP response:               (6)
bool isFarenheit)”. We have to ask the Web service to
                           “Cloudy with chance of
describe itself (i.e. tell us exactly how we should
                           Meatballs”
invoke it).                                                                    35
Discovery     UDDI   Discovery, aggregation, etc.


                     WSDL
Description   WSDL   Web Services description language

                     The most popular invocation protocol is SOAP
XML messaging SOAP   But we could, in theory, use other protocols.

                     The most popular transport protocol is HTTP,
Transport     HTTP   But we could, in theory, use other protocols.




                                                                     36
   Service Discovery
    ◦ This layer is responsible for centralizing services
      into a common registry, and providing easy
      publish/find functionality. Currently, service
      discovery is handled via Universal Description,
      Discovery, and Integration (UDDI)
   Service Description
    ◦ One of the most interesting features of Web
      services is that they are self-describing. This
      means that, once you‟ve located a Web service,
      you can ask it to „describe itself‟ and tell you what
      operations it supports and how to invoke it. This
      is handled by the Web Services Description
      Language (WSDL).


                                                              37
   XML messaging
    ◦ This layer is responsible for encoding messages in a
      common XML format so that messages can be understood
      at either end. Currently, this layer includes XML-RPC and
      SOAP.
   Service Transport
    ◦ This layer is responsible for transporting messages
      between applications. Currently, this layer includes
      hypertext transfer protocol (HTTP), Simple Mail Transfer
      Protocol (SMTP), file transfer protocol (FTP), and newer
      protocols.




                                                                  38
39
               standard interfaces
                and technologies

The Internet
  (Content,
Information,
  Graphics)




                                     40
Web pages only have
static information
 The same information
is provided for all
viewers




                        41
<html>
<head>
 <title>Best Auto Insurance</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
 <img src="images/BestAutoInsuranceLogo.jpg">

 Please locate your estimated auto insurance quote by locating the most
 similar car type and price together with your home location: <p>

 4-Door Sedan (Price: approximately $12,000)<p>

       Zipcode: 02139 :    $ 2,000<p>
       Zipcode: 02138 :    $ 2,150<p>
  .
  .
  .


                                                                          42
   A web page-based auto insurance site has many
    problems:
    ◦ The page must include all types of cars and all zip codes,
      which makes the page very long and cramped
    ◦ The overflow of information on the page makes it difficult to
      read and use
    ◦ The page does not look nice, clean, and aesthetically pleasing

   Instead of listing ALL of the information on a page, a
    better idea is to allow the user to enter his particular
    information, and have the particular result calculated
    and displayed on the page
    ◦ The motivation for Web Applications

                                                                       43
44
1. The user enters their car’s information into the browser
                                      2. The Web application running on the
                                      server processes the information about
                                      the user’s car and calculates an
                                      estimated insurance premium.




 3. The user sees the estimated insurance
 premium on the browser.




                                   The process is easy, fast, and simple.




                                                                            45
46
47
                   Manufacturing        Means of Communications
                     Company
                                        phone
                                        fax
                                        human Web site interaction




 Courier                            Courier
Company 1                          Company 2


        Parts                Parts
      Supplier 1           Supplier 2



                                                                     48
Consumer Application



                                               Means of Communications

                 Very Best Auto Insurance       phone
                                                fax
                                                human Web site interaction




Auto Insurance                              Auto Insurance
 Company 1                                   Company 2



                                                                             49
Auto Insurance Company 1




                           Very Best Auto Insurance




Auto Insurance Company 2
                                                      50
51
Monolithic Applications




             Web Services-based
                Applications




                                  52
   amazon Web Services
   http://aws.amazon.com




                            53

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:17
posted:12/9/2011
language:
pages:53