Web Service Discovery Protocol

Document Sample
Web Service Discovery Protocol Powered By Docstoc
					Why Discovery?

• Some Web Services must be discoverable to be useful
   – "business partner" services must be pre-arranged
      • only the "current" endpoint is discoverable
   – some services are localized (find a restaurant)
      • discover them relative to your location
   – analogous services may provide different quality of service
      • discovery of replaceable multiple implementations




                                                                   2
Discovering Web Services

• Web Service discovery mechanisms may include
  – personal knowledge (arrange with a business partner)
  – service brokers (XMethods)
  – find services when you know the server
  – replicated central directories of information (UDDI)




                                                           3
What are you discovering?

• Discoverables center around WSDL files that contain
   – references to schemas used
   – message exchange specifics
   – references to definitions of "interfaces" and methods
   – protocol details
   – web service endpoints




                                                             4
Patterns of Discovery

• Three general patterns emerge
   – Web Services offered by a given company
   – who implements a given well-defined service?
   – find services by category or taxonomy




                                                    5
Standardization of Discovery Mechanisms

• De facto standards are evolving for discovery
   – UDDI - centralized searchable directory of services
   – WS-Inspection - server-specific dynamic service list
   – WS-Inspection is one of the GXA family of specs
      • Disco was a Microsoft-specific precursor
      • ADS was IBM-specific precursor




                                                            6
What is WS-Inspection?

• WS-Inspection exposes a list of information at a well-known
  location on a per-server basis
   – by convention, the endpoint is http://server/inspection.wsil
   – list of info can be considered a web service business card
   – similar to going to http://www.company.com and looking at the
     table of contents




                                                                     7
What's in a WSIL document?

• WSIL documents can contain pointers
  – pointers can reference other WSIL docs
  – pointers can reference UDDI company info
  – vendor-specific pointers are permitted




                                               8
WS-Inspection document (1)
<?xml version="1.0" encoding="utf-8"?>
<inspection xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsiluddi="http://schemas.xmlsoap.org/ws/2001/10/inspection/uddi/"
xmlns="http://schemas.xmlsoap.org/ws/2001/10/inspection/">

 <!-- link to another WS document -->
 <link referencedNamespace="http://schemas.xmlsoap.org/ws/2001/10/inspection/"
       location="http://localhost/AuthorsService/authors.wsil">
 <abstract>A link to the Authors Service document</abstract>
 </link>

 <!-- link to UDDI -->
 <link referencedNamespace="urn:uddi-org:api">
 <wsiluddi:businessDescription
      location="http://test.uddi.microsoft.com/uddi/search.aspx">

    <!-- either one of the next two are OK -->
    <wsiluddi:businessKey>
       C3D1746D-13CB-4C9E-818B-1CCBFA844C18
    </wsiluddi:businessKey>
    <wsiluddi:discoveryURL useType="businessEntity">
      http://test.uddi.microsoft.com/details/businessdetail.aspx?
      businesskey=C3D1746D-13CB-4C9E-818B-1CCBFA844C18
    </wsiluddi:discoveryURL>
 </wsiluddi:businessDescription>
 </link>


                                                                                 9
 WS-Inspection document (2)
<?xml version="1.0" encoding="utf-8"?>
<inspection xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsiluddi="http://schemas.xmlsoap.org/ws/2001/10/inspection/uddi/"
xmlns="http://schemas.xmlsoap.org/ws/2001/10/inspection/">

  <!-- vanilla service element pointing at a WSDL location -->
  <service>
    <abstract>This is a test of the ASP.NET declarative attributes</abstract>
    <name>Attribute Tester</name>
    <description referencedNamespace="http://schemas.xmlsoap.org/wsdl/"
       location="http://localhost/WebServiceTester/Attrib.asmx?WSDL" />
  </service>
  <service>
    <abstract>This is a test of Xml Object serialization</abstract>
    <name>ObjectXml Tester</name>
    <description referencedNamespace="http://schemas.xmlsoap.org/wsdl/"
       location="http://localhost/WebServiceTester/ObjectXml.asmx?WSDL" />
  </service>
  <service>
    <abstract>This is a test of XmlSerializer with SOAP attributes</abstract>
    <name>ObjectSoap Tester</name>
    <description referencedNamespace="http://schemas.xmlsoap.org/wsdl/"
       location="http://localhost/WebServiceTester/ObjectSoap.asmx?WSDL" />
  </service>
</inspection>


                                                                                10
WS-Inspection and DISCO

• DISCO and WS-Inspection overlap in functionality
   – both document types may be dynamically generated
   – both provide information and pointers
   – WS-Inspection may contain DISCO pointers
   – parts of WSIL files can be derived from corresponding DISCO




                                                             11
How does DISCO work in .NET?

• System.Web.Services.Discovery
   – DiscoveryClientProtocol is the central class
      • Discover/DiscoverAny
      • Resolve/ResolveAll
      • Download, Read and Write
   – ResolveAll uses ADSI to scan the IIS metabase




                                                     12
DiscoveryClientProtocol methods
public class DiscoveryClientProtocol
{
  ...
  // these are for dynamic discovery
  public DiscoveryDocument Discover(string url);
  public DiscoveryDocument DiscoverAny(string url);

    public void ResolveAll();
    public void ResolveOneLevel();

    // these are used in DISCO.exe
    public Stream Download(ref string url);
    public Stream Download(ref string url,
                           ref string contentType);
    public DiscoveryClientResultCollection ReadAll(
                           string topLevelFilename);
    public DiscoveryClientResultCollection WriteAll(
                           string directory,
                           string topLevelFilename);
}


                                                       13
What else is in a WSIL document?

• WSIL documents can contain descriptions
  – Information consists of web service description and WSDL
    endpoints
  – Protocol specific information extensions exist for
     • WSDL
     • UDDI
  – Vendor-specific information can be added




                                                               14
Comparing DISCO and WSIL

DISCO:                      WSIL:
                            Pointers to other WSIL
                            files

Pointers to other           Pointers to other
 Disco files                 discovery files

Web Service documentation   Pointers to UDDI business
endpoints                   info

WSDL endpoint information   WSDL endpoint information

Referenced XSD endpoints    WSDL extended information

                            UDDI Web Service
                            information



                                                        15
Implementation of Discovery in .NET

• DISCO can get Web Service information
   – using ASP.NET HttpHandler mapped to .vsdisco files
   – using DISCO.exe command line utility




                                                          16
DISCO implementation utilities

<configuration>
<system.web>
 <!-- Note: this is commented out in V1.0 machine.config -->
 <httpHandlers>
  <add verb="*" path="*.vsdisco"
    type="System.Web.Services.Discovery.DiscoveryRequestHandler,
    System.Web.Services, Version=1.0.3300.0, Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
    <!-- .... -->
 </httpHandlers>
</system.web>
<configuration>


-- start with Default.vsdisco
-- put files in c:\temp

>disco http://localhost/Default.vsdisco /out:c:\temp



                                                                   17
An implementation of WSIL

• You can produce a WSIL document from DISCO info
   – invoke dynamic DISCO using DiscoveryClientProtocol class
   – transpose WSDL information retrieved to WSIL elements
   – this can be exposed through an ASP.NET HttpHandler class




                                                                18
Using WSIL

• You can use WSIL information in a variety of ways
   – most commonly obtain WSDL documents (Add Reference)
   – get business info through UDDI reference extensions
   – get WSDL documents through UDDI
      • get service info
      • get tModels from service info
      • tModels can contain refs to WSDL documents




                                                           19
WSIL document generation


<configuration>
<system.web>
 <httpHandlers>
  <add verb="*" path="inspection.wsil"
     type="WSILFromDiscoLib.WSILFromDisco, WSILFromDiscoLib"/>
    <!-- .... -->
 </httpHandlers>
</system.web>
<configuration>




                                                                 20
UDDI

• UDDI defines how to interact with a rich Web service
  information repository
   – UDDI jointly developed by Microsoft, IBM, and Ariba
   – UDDI itself is SOAP-based Web service
   – UDDI specification consists of programmer's API (SOAP
      requests/responses) and operator's site APIs




                                                             21
UDDI servers

• An "operator site" implements the UDDI specification
   – can be a public or private site
   – public operator sites replicate information (like DNS)
   – replication specifications are part of UDDI 2.0
   – Microsoft, IBM, and others all have operating sites available
     today




                                                                     22
UDDI Information Items

• UDDI registry consists of four main types of information
   – business information consists of name, contact info, services
   – service information provides business/technical descriptions of
     service
   – binding template defines how to connect to and communicate
     with service
   – tModel provides a technical fingerprint for interfaces/behavior
     (or anything else)
   – v2.0 adds publisher assertions
       • used for companies that are related, but separate




                                                                       23
UDDI Information




             Name      Retail    URL
             Address   Health    WSDL
             Contact   Finance   tModel
             ....      ...       ...




                                          24
Relationships among UDDI items

• Most UDDI data items are hierarchically related
   – businessEntity is parent of businessService (1-many)
   – businessService is parent of bindingTemplate
   – tModels are references not hierarchical
   – publisherAssertions relate two businessEntities




                                                            25
UDDI Information Items




             business

                              tModel
                 service



                    binding




                                       26
UDDI Programmer's API

• The UDDI Programmer's API is divided into two groups of
  operations: inquiry and publishing
   – inquiry API retrieves information from registry
   – inquiry API doesn't require authentication
   – publishing API inserts/updates information in[to] registry
   – publishing API does require authentication and encryption




                                                                  27
UDDI Inquiry API




                 Name                                      Description
        find_business             Locates information about one or more businesses.
        find_service              Locates services within a registered businessEntity.
        find_binding              Locates bindings within a registered businessService.
        find_tModel               Locates one or more tModel information structures.
        get_businessDetail        Gets businessEntity information for one or more businesses.
        get_businessDetailExt Gets extended businessEntity information.
        get_serviceDetail         Gets full details for a set of registered businessServices.
        get_bindingDetail         Gets bindingTemplate information for making service requests.
        get_tModelDetail          Gets details for a set of registered tModels.




                                                                                                  28
UDDI Publishing API



                Name                               Description
         get_authToken        Requests an authentication token from an operator site.
         get_registeredInfo   Requests information currently managed by user.
         save_business        Registers/updates a businessEntity.
         save_service         Registers/updates a businessService.
         save_binding         Registers/updates a bindingTemplate.
         save_tModel          Registers/updates a tModel.
         delete_business      Deletes a businessEntity from registry.
         delete_service       Deletes a businessService from registry.
         delete_binding       Deletes a bindingTemplate from registry.
         delete_tModel        Deletes a tModel from registry.
         discard_authToken    Discards an existing authentication token.




                                                                                        29
Taxonomies, Identifiers and CategoryBags

• UDDI information includes classification information
   – businessEntity contains:
      • identifierBag - e.g. DUNS (these are tModels)
      • categoryBag - e.g. SIC, Geo3166 (these are tModels)
   – businessService contains categoryBag (can be tModels)
   – bindingTemplate requires tModelKey
   – tModels contain
      • identifierBag
      • categoryBag




                                                              30
Searching

• Identifiers and categories enable searching
   – by known taxonomies (DUNS, Geo3166)
   – by arbitrary user-defined classifications
• UDDI 2.0 contains specifications for known taxonomies
   – defines validated and non-validated taxonomies
   – taxonomy specs and placement details
   – checked namespaces
      • extension specs for categorization and identification
      • instructions for site operators
   – info on how to add a taxonomy




                                                                31
UDDI Support in .NET

• UDDI support in .NET includes clients and servers
   – UDDI 1.0 server in .NET server
   – UDDI 1.0 clients downloadable
      • .NET client v1.75 for RTM
      • UDDI 1.0 COM client
   – UDDI 2.0 beta client available for .NET




                                                      32
Summary

• WS-Inspection and UDDI emerging as discovery methods
  – WSIL is local machine, business card approach
     • you know where the implementing server is
  – UDDI is centralized service approach
     • you know nothing but where the UDDI server is
  – WSIL can be implemented in .NET over DISCO
  – UDDI 1.0 and 2.0 .NET client libraries available
  – UDDI 1.0 server available in .NET server




                                                         33

				
DOCUMENT INFO
Shared By:
Tags: Services
Stats:
views:42
posted:5/4/2011
language:English
pages:33
Description: Web Services released by the company to fulfill its specific business needs of online application services, application software to other companies or through the Internet to access and use the online service.