- Inquiry APIs
- Establishing Connection
- The Inquiry Process
- Using Discovered Services
- For More Information
The Inquiry Process
For an application to discover a particular service with minimal manual intervention, a structure must be in place that supports the path to the desired service. The classification and service interaction specifications provide just that structure. Business entities and services are classified within this framework (see Figure 2) and the inquiry process navigates this structure.
Figure 2 Inquiry structure in the UDDI registry.
The process of finding a service depends on the information available about the type or class of services to be discovered. The UDDI specification provides several APIs to discover various resources in the registry. This article focuses on the following types of queries:
Find service interface (tModel)
Find service
Find business entity
Usually, many details are published along with the main resource (whether a service, business entity, or a tModel). Quite a few of these details are searchable:
Name
Category key
Unique identifier key
Applicable tModel
Parent resource
A service consumer application can be designed to search on any number or combination of these types of details. However, the UDDI registry is designed for use in an ecosystem paradigm. Following is the typical scenario for which a service consumer application is designed:
Find all the relevant service interaction specifications.
Choose one that seems to suit your needs.
Find all the services that comply with that particular service interaction specification.
Choose the service that's most suitable.
Find the responsible business entities for the discovered services.
A service consumer may have an existing relationship with a service provider and want to search for all of its services. In this case, the inquiry process may simply include searching for all services provided by that business entity.
Let's consider an example. American Corporation, Inc. (ACI) is a company with a sizable workforce. Having recently decided to offer 401(k) plans to its employees, ACI researches the pension fund industry and comes to the conclusion that FITSO compliancy is an important criteria in selection; therefore, ACI has determined that it will work only with FITSO-compliant 401(k) service providers. The next three sections explain ACI's electronic inquiry process as supported by the UDDI registry.
Discovering a Service Interaction Specification
Figure 3 depicts a typical inquiry sequence for a service consumer. At the beginning of the inquiry process, the consumer usually knows only that the desired services abide by a certain interaction specification. In this example, ACI is looking for services that comply with the specification TM401k that FITSO published to the UDDI registry; this specification provides guidance on what features FITSO-compliant 401(k) service providers should include.
Figure 3 Ecosystem-based inquiry.
Remember that calls made to the inquiry URL are not secured because no authentication is required (especially in the case of the UBR used in these examples). The main configuration is simply denoting the inquiry URL with which the service consumer wants to communicate.
The class FindTModel is the starting point to find a tModel. FindTModel provides several methods to construct registry queries to search tModels. Queries can be designed to handle a broad-based search of interaction specifications and classification schemes, or a more refined search using more information about the interaction specification. In our example, the broader case simply uses a wildcard search to find particular characters in the name of the specification tModels published in the registry; the more refined search will be based on category.
Broad-Based Search
A broad-based search is not always sufficient. One of the goals of XML-based registries is to assist in the electronic decision-making process. Simply doing a wildcard search would require a manual selection after finding the interaction specifications. Given no other guidance, a manual decision process would be the only option. Entities such as consortiums and governing bodies should provide more details as to how to reach the exact interaction specification. Ideally, they would provide the following details:
Interaction specification name
Classification scheme and details
Refined Search
FITSO provides detailed interaction information in their specification. Using these guidelines, ACI can refine its search to locate interaction specifications with a specific name and classification type: The TM401k specification was published within the general_keyword taxonomy, with the keyword 401k. (Behind the scenes, a CategoryBag structure is constructed to store the additional information and prepare the appropriate inquiry XML to run on the UDDI registry.)
The Send method communicates the query to the UDDI registry:
FindTModel ftm = new FindTModel(); ... ftm.CategoryBag.Add(); ftm.CategoryBag[0].TModelKey = "tModel key from publish"; ftm.CategoryBag[0].KeyName = "KEYWORD"; ftm.CategoryBag[0].KeyValue = "401(k)"; TModelList tml = ftm.Send(); foreach( TModelInfo tmi in tml.TModelInfos ) { Console.WriteLine(tmi.Name); Console.WriteLine(tmi.TmodelKey); }
Using the found tModel data, the following code segment uses the unique identifier and the class GetTModelDetail to display the description and overview documents associated with each tModel:
GetTModelDetail gtmd = new GetTModelDetail(); gtmd.TModelKeys.Add("Put a specific tModel key here"); TModelDetail tmd = gtmd.Send(); ... foreach(TModel tm in tmd.TModels) { // Show overview document descriptions foreach( Description d in tm.OverviewDoc.Descriptions ) }
Discovering a Service
After obtaining the appropriate tModel key for the service interface specification, ACI can find the services that comply with that specific tModel. For the sake of explanation, we'll call this the compliance tModel. In this example, the FITSO TM401(k) tModel is the compliance tModel.
Discovering a service is very similar to the process for discovering a tModel (or even a business). Using the service name and the compliance tModel key, ACI can locate one or more of the services that comply with the FITSO tModel:
FindService fs = new FindService(); fs.Names.Add("%401%k%"); fs.TModelKeys.Add("Put compliance tModel key here"); ServiceList sl = fs.Send();
TIP
I haven't constructed a query based on the CategoryBag structure as I did for tModels, but a similar approach is used. Queries based on categories would be useful if we were searching for a genre of services rather than a set of services that complied with a specific service interaction specification.
The results of the query return the service name as well as the service identification keys. These keys are useful because they provide direct access to the service for future use.
GetServiceDetail gsd = new GetServiceDetail(); gsd.ServiceKeys.Add("Put service UUID key here"); ServiceDetail sd = gsd.Send(); ... Console.WriteLine("Responsible Business"); GetBusinessDetail gbd = new GetBusinessDetail(); gbd.BusinessKeys.Add(bs.BusinessKey); BusinessDetail bd = gbd.Send(); foreach(BusinessEntity be in bd.BusinessEntities) Console.WriteLine(be.Names[0].Text);
Additional service details can be obtained for the services that result from the posed query, with the registry using the GetServiceDetail class.
Discovering a Business Entity
At this point, we've traversed a complete discovery pattern, where we discovered a tModel based on certain keywords, discovered a set of services that complied with the specific tModel, and obtained more information about the business entity that owned the service.
Another discovery pattern is also possible when a potential service user is aware of existing entities that might serve as business partners. In this situation, discovery would happen in reverse order: The business entity would be discovered first, followed by the services it offers.
For discovering a business entity, the class FindBusiness acts as the central point, where the search criteria are provided. In this example, it includes a taxonomy under which the business entity is classified:
FindBusiness fb = new FindBusiness(); //Add taxonomy KeyedReference kr = new KeyedReference(); kr.TModelKey = "Put taxonomy tModel key here"; kr.KeyName = "Pension fund, third party administrative services"; kr.KeyValue = "524292"; fb.CategoryBag.Add(kr); ... BusinessList bl = fb.Send();
The class GetBusinessDetail gets detailed information about the chosen business entity:
GetBusinessDetail gbd = new GetBusinessDetail(); gbd.BusinessKeys.Add("Put specific business key here"); BusinessDetail bd = gbd.Send(); foreach(BusinessEntity be in bd.BusinessEntities) { // Code to obtain specific business entity information }
Search Qualifiers
The default behavior for inquiry APIsincluding those for finding businesses, services, and tModelsexecutes queries with a ANDed set of search criteria. However, this behavior can be modified using the optional element findQualifier. The UDDI V2 specification supports six built-in findQualifier values, which can be enhanced to support an even wider range of search qualifiers as needed for specialized environments. This is especially useful in a private registry deployment, where specialized searches might be desired.