Building a Web Service - PowerPoint PPT Presentation

1 / 25
About This Presentation
Title:

Building a Web Service

Description:

Create a Client application to ... Click the Invoke button to test the Web Service. Web Service Presentation ... point to Add Project and then click New ... – PowerPoint PPT presentation

Number of Views:35
Avg rating:3.0/5.0
Slides: 26
Provided by: kevin87
Category:
Tags: building | click | client | service | to | web

less

Transcript and Presenter's Notes

Title: Building a Web Service


1
Astron International, Inc.
  • Building a Web Service
  • HDNUG
  • October 24, 2001

2
Topics
  • What Is A Web Service?
  • Web Service Architecture
  • Types Of Services
  • Static Information
  • Database
  • Processing
  • Creating A Web Service
  • Consuming A Web Service
  • Case Study Metal Pricing Web Service
  • Q A

3
What is a Web Service?
  • A Web Service is a unit of application logic
    providing data and services to other
    applications. Applications access Web Services
    via ubiquitous Web protocols and data formats
    such as HTTP, XML, and SOAP, with no need to
    worry about how each Web Service is implemented.
    Web Services combine the best aspects of
    component-based development and the Web, and are
    a cornerstone of the Microsoft .NET programming
    model.

4
Web Service Architecture
  • Basic structure of a Web Service

5
Types of Services
  • Static Information
  • Returns information that is hard coded into the
    service, such as Hello World
  • Database
  • Retrieves data from a data source, such as SQL
    Server, and returns it
  • Processing
  • Performs some type of processing, such as
    calculating the Reorder Levels for an inventory
    application

6
Creating a Web Service
  • Design The Web Service
  • Create The Web Service Project In VS.Net
  • Develop The Web Service
  • Test And Debug The Web Service
  • Deploy The Web Service
  • Create a Client application to consume the service

7
Designing a Web Service
  • Decide On The Target Audience
  • Which Language, VB or C or
  • Outline The Process

8
Creating a Web Service Project
  • Click File ? New and then click Project
  • In the New Project dialog box, select either the
    Visual Basic Projects or Visual C Projects
    folder
  • Click the ASP.NET Web Service icon
  • Change the name of the project
  • Enter the address of a Web server on which you
    will develop the Web Service. By default, the
    project will use your local machine,
    http//localhost
  • Click OK to create the project

9
Developing aWeb Service
  • Add a WebMethodAttribute Class
  • Add the required code
  • Save the project

10
Testing and Debugging aWeb Service
  • Set a breakpoint in the Web Service code
  • Set the Start Page
  • Start the project in Debug Mode
  • Click the Operation that is supported on the
    Service Helper Page
  • Click the Invoke button to test the Web Service

11
Deploying aWeb Service
  • Web Services are made up of two applications
    the Web Service, and the Client.
  • Deploy the Web Service to a Web server that is
    accessible to the clients you wish to support
  • Add a Web Setup project to your solution
  • Copy the required files to the destination server

12
Adding a Web Setup Project
  • On the File menu, point to Add Project and then
    click New Project
  • Select the Setup and Deployment Projects folder
    and then click Web Setup Project
  • In Solution Explorer, right-click on the project
    name, point to Add, and then click Project Output
  • In the Add Project Output Group dialog box,
    select Primary output, Debug Symbols and Content
    Files. Click OK
  • On the Build menu, click Build Solution

13
Copying the Required Files
  • Build the project
  • On the Project menu, click Copy Project.
  • In the Destination project folder box, enter the
    location to which you want to copy the project.
  • Click either FrontPage or File share to select a
    Web access method. For more information, see
    Changing Web Project Access Methods.
  • Click Only files needed to run this application.
  • Click OK

14
Consuming a Web Service
  • Create a Client Project
  • Add a Web Reference
  • Create the Interface
  • Write the Code
  • Run the Application
  • Deploy the Client

15
Creating a Client Project
  • On the File menu, point to New, and then click
    Project to open the New Project dialog box.
  • Expand either the Visual Basic Projects or the
    Visual C Projects folder.
  • Click the ASP.NET Web Application icon.

16
Adding a Web Reference
  • On the Project menu, click Add Web Reference
  • In the Address box of the Add Web Reference
    dialog box, type the URL to the .disco file of
    the Web Service you want to access or If you
    created the Web Service on your local machine,
    click the Web References on Local Web Server link
  • When you obtain the discovery document, select
    the desired Web Service in the Available
    references box
  • Click Add Reference to add a Web reference for
    the target Web Service. Visual Studio will
    download the service description and generate a
    proxy class to interface between your application
    and the Web Service
  • In Solution Explorer, expand the Web References
    folder
  • Rename the Web reference if necessary

17
Creating the User Interface
  • Add the Controls to the Design Page

18
Write the Code
  • Add Code to the Button1_Click Event

19
Run the Code
  • Press F5 to build the project and run the code
  • The client application will start and access the
    TempConvert1 Web Service

20
Deploy the Code
  • Create a Web Setup Project just like in the Web
    Service Section
  • Build the Project

21
Web Service Case Study
  • Clients Business Challenge
  • Clients Web Service Architecture
  • Benefits to Client

22
Clients Business Challenge
  • Client corporation required a means to present
    updated precious metal prices to its customers
    on a daily basis
  • Clients desire is to provide the updates
    automatically, each day, as they are posted to
    their mainframe

23
Clients Web ServiceArchitecture
24
Benefits to Client
  • Automated Pricing Updates
  • One Source Pricing
  • 24 X 7 Customer Access
  • Excellent ROI
  • Professional Look
  • Industry Leading Technology
  • Reusable Resource

25
Q A
Write a Comment
User Comments (0)
About PowerShow.com