Creating Consuming Web Services MIS 424 Professor Sandvig Overview – Web Services What are Web Services Benefits Who is using them Using in NET – How to crea by kwd15566

VIEWS: 16 PAGES: 18

									Creating & Consuming Web
         Services

           MIS 424
      Professor Sandvig
  Overview – Web Services
What are Web Services?
Benefits
Who is using them
Using in .NET
– How to create
– How to consume
   What are Web Services?
Web services allow applications to communicate
with each other via Internet

Islands of data
Huge databases
– Every large organization
– Can’t communicate, share
    Between organizations
    Within organizations
   What are Web Services?
Underlying Technologies
– XML
    Defines data content
– SOAP
    Simple object access protocol
        – Protocol  rules
    Advantage
        – HTTP: name-value pairs
        – SOAP:
             data relationships
             Data types
Both are W3.org standards
– Supported by all major vendors
                  Why Now?
Historically
– Physical distance
– Small data pipelines
Now
– Internet, fiber optics, …
– Distance not a problem
      Recent: mid-1990’s
Limitation
– Need common language & protocols
Solution
– Web Services: XML & Soap
                 Who is using?
Amazon
– Retrieve shipping info
– Expose product database

UPS
– Shipping status, pricing information, etc.

Google
– Expose database
– Tap creativity of programmers
      Ideas for free

Others??
– Difficult to tell, background process
Using Web Services in .NET
Web Service Namespaces
– Implements XML & SOAP technologies
– Dozens of classes
    High level
    Handle messy details
– MSDN Documentation

Heavily promoted functionality of .NET
      Using Web Services
Two roles:
– Create
    Expose your data/application to other
– Consume
    Utilize web services offered by others
   Creating Web Services
Visual Studio:
– Add new item: Web Service
     .asmx file
       Creating Web Service
Default .asmx file:
    Creating Web Services
Example:
Testing
– Via HTTP
    Request .asmx file
– CreateWebService.asmx, (source .doc)
   Consuming Web Service
Create proxy
– Visual Studio
  1. Add new web reference
  2. Paste in web service description language (wsdl)
     –   VS creates classes that utilize service
  3. Use like any other classes
 Consuming Web Service

Paste URL of WSDL into VS:
   Consuming Web Service
WSDL returns service description:
– Click “Add Reference”
  Consuming Web Services
Service now represented by class:
   Consuming Web Service
Service methods visible via Intellisense:
   Consuming Web Service
Example:
– ConsumeWebService.aspx

– .asmx files can handle AJAX calls
    See assignment 4

– ObjectDataSource control:
    Use VS wizard to select web service class
  Summary – Web Services
Allow applications to communicate
– Connect islands of data
Emerging technology
– Not widely used yet
– High expectations
.NET support
– Very easy to publish & consume

								
To top