Web Services - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Web Services

Description:

Example: Yahoo stock ticker. Yahoo has tons of stock price history behind http://quote.yahoo.com ... Public class Greetings. Web methods: ... – PowerPoint PPT presentation

Number of Views:58
Avg rating:3.0/5.0
Slides: 16
Provided by: muX
Category:

less

Transcript and Presenter's Notes

Title: Web Services


1
Web Services
  • What is web services
  • How to program web services in ASP.NET
  • What e-commerce business models do web services
    enable

2
Current Web Usage
  • User-oriented browsing and data publication
  • Users browse for information
  • Vast databases are accessed through HTML gateways
    and user-friendly displays
  • Example Yahoo stock ticker
  • Yahoo has tons of stock price history behind
    http//quote.yahoo.com
  • That information is easily accessible to anyone
    browsing the page
  • But it is not easily extracted to be used by a
    program

3
XML and E-Commerce
  • In the real-world, computers and database systems
    contain data in different formats.
  • For developers one of the time-consuming most
    challenging tasks is to exchange data between
    systems over the Internet
  • XML can used to store data and share data, thanks
    to its plain text format (easy to share) and
    flexibility.

4
What is Web Services
  • Software components (application logic)
    accessible via standard Web protocols
  • Loosely coupled, reusable software components
    that semantically encapsulate discrete
    functionality and are distributed and
    programmatically accessible over standard
    Internet protocols (Stencil Group)

5
What is Web Services (Contd)
  • Web site with no user interface, but program
    interface programming the web
  • Available to any client that speaks the right
    language--Web protocols (XML, SOAP, WSDL)
  • Platform independent components
  • Application Programming Interface (API) machine
    to machine

6
Web Services in ASP.NET
  • Filename .asmx
  • Greetings.asmx
  • lt_at_ WebServicegt tag
  • Namespace imports system.web.services
  • Class definition
  • The ltWebMethod()gt tag making it available to
    outside world (like API)
  • Communicating between client and server through
    WS
  • HTTP request and response
  • SOAP wrapper sent as part of request/response

7
The Program
  • Greetings.asmx
  • Running on localhost, the web server on local
    machine
  • Hello( ) is a public method of the Greetings class

8
Sending Data Using HTTP GET
  • When the data is sent via HTTP GET,
    Request.QueryString can be used to access the
    name-value pairs
  • Syntax of GETGET /class/590f04/code/greeting.asm
    x/Hello?NameYao HTTP/1.1Host localhost

9
Sending Data via HTTP POST
  • Post /class/295s04/code/greetings.asmx/Hello
    HTTP/1.1
  • Host localhost
  • Content-Type application/x-www-form-urlencoded
  • Content-Length 15
  • NameYao
  • (The last line of the example in the book, on
    Page 673, should be deleted)

10
Sending Information via SOAP
  • Simple Object Access Protocol
  • Wraps up information inside an XML element,
    called a SOAP envelope, and send it via HTTP
  • See example on Page 612
  • SOAP is the default Web Services protocol to send
    information in ASP.NET

11
Building Web Services in ASP.NET
  • Four essential parts of WS
  • Processing directive lt_at_ WebService
    Languagevb Classgreetingsgt
  • Name spacesimports System.Web.Services
  • Public classPublic class Greetings
  • Web methodsltWebMethod()gt Public Function
    Name(Input as DataType) as Datatype

12
Creating a Web Service with Multiple Web Methods
  • The Measurement Conversion Example
  • Multiple web methods in one web service class
  • WSDL the Web Service Description Language
  • Describes the input and output parameters of a
    web service
  • Itself an XML file

13
Why Are Web Services Interesting?
  • For developers
  • Access to a Web-wide library of software
    components
  • Smart development tools can
  • Help you locate useful Web Services
  • Download service descriptions (WSDL)
  • Automatically generate code from the WSDL to talk
    to the service using SOAP over HTTP
  • On the server side, automatically generate WSDL
    for a service from its source code

14
Advantages For Businesses
  • Better information availability Any-to-Any
    integration
  • Integral assumption of development
  • Must tie together islands of data, devices, OS,
    businesses, people
  • New revenue opportunities
  • Intelligent consumer devices
  • New services
  • Better customer service
  • Open, internet based standards
  • Broad accessibility

15
Benefits of Web Services
  • Reduction of integration cost
  • Currently 7 for ever 1 of software purchase
  • Connect with and reuse existing assets
  • Increase revenue opportunities
  • Extend to new end-points and devices
  • Broaden partnerships
  • Expose functionalities within a program
  • Enabling value chain integration
  • Collaboration among several firms
  • More use for customer and business information
    shared across firms
Write a Comment
User Comments (0)
About PowerShow.com