Consuming Web Services - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Consuming Web Services

Description:

'A web service is a piece of business ... Using a web service could be as simple as logging into a site or as complex as ... Prelude of Using the Proxy Class ... – PowerPoint PPT presentation

Number of Views:16
Avg rating:3.0/5.0
Slides: 15
Provided by: haimin8
Category:

less

Transcript and Presenter's Notes

Title: Consuming Web Services


1
Consuming Web Services
  • MIST4630

2
What are Web Services
  • A web service is a piece of business logic,
    located somewhere on the Internet, that is
    accessible through standard-based Internet
    protocols such as HTTP, or SMTP. Using a web
    service could be as simple as logging into a site
    or as complex as facilitating a
    multi-organization business negotiation.
    (Chappell Jewell, Java Web Services, 2002)

3
According to W3Schools
  • Web services are units of code located on some
    server on the Internet
  • Web services are designed to work with
    third-party code
  • Described using a service description language
  • Web services use XML based communicating
    protocols
  • Web services are independent of operating systems
  • Web services are independent of programming
    languages
  • Web services connect people, systems and devices

4
Benefits of Web Services
  • Easier to communicate between applications
  • Easier to reuse existing services
  • Easier to distribute information to more
    consumers
  • Rapid development
  • Web services make it easier to communicate
    between different applications. They also make it
    possible for developers to reuse existing web
    services instead of writing new ones.
  • Web services can create new possibilities for
    many businesses because it provides an easy way
    to distribute information to a large number of
    consumers. One example could be flight schedules
    and ticket reservation systems.

5
Major Web Services Technologies
  • HTTP
  • XML
  • SOAP Simple Object Access Protocol
  • SOAP some say Service-Oriented Architecture
    Protocol
  • WSDL Web Service Description Language
  • UDDI Universal Description, Discovery, and
    Integration

6
XML Web Services Infrastructure
7
Resources
  • Read introduction and case studies on the
    following web sites
  • http//www-306.ibm.com/software/solutions/webservi
    ces/overview.html
  • http//www.w3schools.com/wsdl/wsdl_uddi.asp
  • www.uddi.org

8
Steps for Consuming Web Services
  • Service discovery locate the WSDL contract for
    the desired web service
  • Make the service local create a Proxy Class, a
    .vb class file
  • Compile the proxy class create a .dll assembly
    and put it in the library
  • Create a new instance of the proxy class in the
    client application and call the desired methods

9
Step 1. Discovering
  • Two methods using UDDI or search engine
  • UDDI
  • Webservice register directories
    (http//www.uddi.com)
  • Provide URL for the applications WSDL file
  • Using search engine
  • Currently, UDDI is in its infancy and you might
    just as well find a web service using a search
    engine such as Google.
  • http//www.webserviceX.NET
  • http//www.capescience.com/webservices

10
Step 2. Create a Proxy Class
  • Create a Proxy Class to communicate with the web
    service resulting a .vb class file
  • Command line
  • wsdl /lvb /outfilename.vb http//domain/folder/f
    ilename.asmx?wsdl

11
Step 3. Compile the Proxy Class
  • Compile the proxy class resulting a .dll
    assembly put it in a /bin folder
  • Command line
  • Vbc /tlibrary /rSystem.Web.dll,System.dll,System
    .Web.Services.dll,System.Xml.dll,System.Data.dll
    /outbin\filename.dll filename.vb

12
Step 2,3. Create Proxy Class in Web Matrix
  • ToolsWebService Proxy Generator

13
Prelude of Using the Proxy Class
  • Investigate the .vb file and get the information
    about class name, methods, and parameters

14
Step 4. Use the Proxy Class
  • Use the class in the same manner as you would use
    a .NET provided class (e.g., an arraylist, or a
    datarow)
  • Import the namespace to your application
  • Instantiate a class object
  • Call the methods
Write a Comment
User Comments (0)
About PowerShow.com