Build a Client Application to Access a UDDI Registry

Build a Client Application to Access a UDDI Registry

n the first article in this series, you saw how the Universal Description, Discovery, and Integration (UDDI) specification and protocol work together to define messages, application programming interfaces (APIs), and data structures for building distributed registries of Web services. You also saw how to store the business and technical information associated with these services. See the sidebar on this page for a review of UDDI’s high-level architecture.

In this article, you’ll see how to build a client application that uses your UDDI registry to locate businesses and services stored there, how to anticipate and handle some common errors, and how to understand some standard details about UDDI SOAP messages.

The Sample Application
To illustrate how to use UDDI from a client application, this article uses a simple sample application in which you can retrieve an authentication token from the registry and list the businesses stored within it.

Any secured access to a UDDI registry must be executed within the realm of authorized permissions defined by an authentication token. This token is passed back to the registry whenever a secured operation is requested.

The UDDI Authentication Model
When a UDDI registry operation requires a user to authenticate, an authentication token must be obtained from the registry. An authentication token is retrieved using the get_authToken message.

The get_authToken message can operate on against any backend security scheme, such as a directory service, operating system, or a simple table of UserIDs and passwords.

The example in Listing 1 illustrates how the sample application uses the org.apache.juddi classes to obtain an authToken.

The get_authToken SOAP Structures
Each UDDI method call requires that your application be able to send and receive properly formatted SOAP structures in the form of request and response documents. The following XML shows the structures required for the get_authToken SOAP request and response.

   // SOAP Request                                    // SOAP Response                              authentication details               

Finding Businesses and Services
Businesses and their associated services can be searched by issuing inquiry messages to a UDDI registry. There are three types of inquiries which you can execute against a UDDI registry:

  1. A white pages inquiry to return basic information such as address, contact, and identifiers about a company and its services.
  2. A yellow pages inquiry to retrieve information concerning categorizations and taxonomies.
  3. A green pages inquiry to retrieve technical information about the Web services a business publishes, as well as information describing how to execute these services.

The UDDI Inquiry API
The UDDI inquiry API consists of operations that enable you to browse and traverse a registry to obtain information about specific businesses and services. Table 1 shows the inquiry API calls that a UDDI registry must support.

Table 1. The table lists the Inquiry API methods that a UDDI registry must support.

Method

Description

find_binding

Used to locate bindings within or across one or more registeredbusinessServices.

find_business

Used to locate information about one or more businesses.

find_relatedBusinesses

Used to locate information about businessEntity registrationsthat are related to a specific business entity whose key is passedin an inquiry.

find_service

Used to locate specific services within registered business entities.

find_tModel

Used to locate one or more tModel information structures.

get_bindingDetail

Used to get bindingTemplate information suitable for making servicerequests.

get_businessDetail

Used to get the businessEntity information for one or more businessesor organizations.

get_businessDetailExt

Used to get extended businessEntity information.

get_serviceDetail

Used to get full details for a given set of registered businessServicedata.

get_tModelDetail

Used to get full details for a given set of registered tModeldata.

Listing 2 illustrates how the sample application uses the org.apache.juddi classes to find businesses.

The find_business SOAP Structures
Here are the SOAP-request and SOAP-response structures required to find businesses in a UDDI registry.

                                                                                                                                                                                                                                             tModelKey5               tModelKey6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 

The find_service SOAP Structures
Similarly, here are the SOAP request and response structures you need to find services using the find_service method.

                                                                                                                                                                                       tModelKey3               tModelKey4                                                                                                                                                                                                                                          

Testing the Sample Application
The sample application uses a simple driver class called “Test” to illustrate how to obtain an authentication token and how to search for particular businesses:

   import org.apache.juddi.datatype.response.AuthToken;   import java.util.Enumeration;      public class Test   {      public static void main(String[] args)      {         Test app = new Test();      }         public Test()      {         GetAuthToken getAuthToken = new GetAuthToken();         AuthToken token = getAuthToken.getToken();         if (token == null)         {            System.err.println(               "Unable to obtain authToken");            return;         }            FindBusinesses findBusinesses = new             FindBusinesses();         Enumeration enum = findBusinesses.find();         while (enum.hasMoreElements())         {            org.apache.juddi.datatype.Name businessName =               (org.apache.juddi.datatype.Name)                enum.nextElement();            System.out.println("Found business: " +               businessName.getValue());         }            getAuthToken.discardToken(token);      }   }

Sample Application Test Results
To run the sample application, you will need to:

 
Figure 1. jUDDI “Happiness” Page: The figure shows the result of running the link The figure shows the result of running the link http://:/juddi/happyjuddi.jsp, which displays jUDDI information.
  1. Start the UDDI registry Web application. Refer to the previous article in this series to learn how to start the Web application.
  2. Populate the business_entity database with one record having a publisher_id of “Sun.”
  3. Populate the business_name database with one record having a name of “Sun.”

With the Web application started, the link http://:/juddi/happyjuddi.jsp will reveal a jUDDI happiness page similar to the page in Figure 1.

After starting the UDDI registry Web application and populating it with a business named “Sun,” you can run the test application. The resulting output should look like Figure 2.

Identifying and Calling Alternate Services

 
Figure 2. Sample Application Output: Here’s what the sample application’s output should look like after starting the UDDI registry Web application and populating it with a single business, named “Sun.”

UDDI allows for multiple bindings or URLs to be associated with the actual physical endpoints to Web services, thus allowing you to provide a failover mechanism in the event that your primary service choice is not available. These endpoints are designated in the tModel data structure of a registry entry.

To review, tModel entries represent technical information about a service or services. This information is embodied within interface specifications such as WSDL documents, XSD files, XML files, etc.

You can also use a businessEntity structure for service failover, because that structure represents all known information about a business and the services that it offers. The following example illustrates a typical businessEntity structure:

                                                                                              

The discoveryURLs element of a businessEntity structure is optional. However, this element contains a list of Uniform Resource Locators (URLs) that can point to alternate document-based service discovery mechanisms.

The discoveryURLs structure holds pointers (a list of discoveryURL elements) to URL-addressable discovery documents that you can retrieve via an HTTP/GET method call. Each discoveryURL element holds a 255-character-length string that represents a Web-addressable discovery document.

UDDI automatically assigns each recorded businessEntity structure a URL that returns the individual businessEntity structure. You conduct a URL search via the find_business call.

For example, here’s a discoveryURL list for a particular businessEntity:

                  http://www.mycompany?businessKey=            BE3D2F08-CEB3-11D3-849F-0050DA1803C0         

Finally, because a UDDI registry acts as an abstract layer between Web service clients and each particular Web service, the registry itself inherently provides a framework for failover and redundancy.

Refer to this DevX Special Report article, “Winning with Web Services” for a detailed look at tModels, discoveryURLs, and the find_business message.

The Universal Description, Discovery, and Integration (UDDI) specification and protocol work together to form one of the primary components of a complete Web services infrastructure. By following the steps shown in the article, you can use your private UDDI registry to find businesses, services, and alternate services.

devx-admin

devx-admin

Share the Post:
Apple Tech

Apple’s Search Engine Disruptor Brewing?

As the fourth quarter of 2023 kicks off, the technology sphere is abuzz with assorted news and advancements. Global stocks exhibit mixed results, whereas cryptocurrency

Revolutionary Job Market

AI is Reshaping the Tech Job Market

The tech industry is facing significant layoffs in 2023, with over 224,503 workers in the U.S losing their jobs. However, experts maintain that job security

Foreign Relations

US-China Trade War: Who’s Winning?

The August 2023 visit of Gina Raimondo, the U.S. Secretary of Commerce, to China demonstrated the progress being made in dialogue between the two nations.

Pandemic Recovery

Conquering Pandemic Supply Chain Struggles

The worldwide coronavirus pandemic has underscored supply chain challenges that resulted in billions of dollars in losses for automakers in 2021. Consequently, several firms are

Game Changer

How ChatGPT is Changing the Game

The AI-powered tool ChatGPT has taken the computing world by storm, receiving high praise from experts like Brex design lead, Pietro Schirano. Developed by OpenAI,

Apple Tech

Apple’s Search Engine Disruptor Brewing?

As the fourth quarter of 2023 kicks off, the technology sphere is abuzz with assorted news and advancements. Global stocks exhibit mixed results, whereas cryptocurrency tokens have seen a substantial

GlobalFoundries Titan

GlobalFoundries: Semiconductor Industry Titan

GlobalFoundries, a company that might not be a household name but has managed to make enormous strides in its relatively short 14-year history. As the third-largest semiconductor foundry in the

Revolutionary Job Market

AI is Reshaping the Tech Job Market

The tech industry is facing significant layoffs in 2023, with over 224,503 workers in the U.S losing their jobs. However, experts maintain that job security in the sector remains strong.

Foreign Relations

US-China Trade War: Who’s Winning?

The August 2023 visit of Gina Raimondo, the U.S. Secretary of Commerce, to China demonstrated the progress being made in dialogue between the two nations. However, the United States’ stance

Pandemic Recovery

Conquering Pandemic Supply Chain Struggles

The worldwide coronavirus pandemic has underscored supply chain challenges that resulted in billions of dollars in losses for automakers in 2021. Consequently, several firms are now contemplating constructing domestic manufacturing

Game Changer

How ChatGPT is Changing the Game

The AI-powered tool ChatGPT has taken the computing world by storm, receiving high praise from experts like Brex design lead, Pietro Schirano. Developed by OpenAI, ChatGPT is known for its

Future of Cybersecurity

Cybersecurity Battles: Lapsus$ Era Unfolds

In 2023, the cybersecurity field faces significant challenges due to the continuous transformation of threats and the increasing abilities of hackers. A prime example of this is the group of

Apple's AI Future

Inside Apple’s AI Expansion Plans

Rather than following the widespread pattern of job cuts in the tech sector, Apple’s CEO Tim Cook disclosed plans to increase the company’s UK workforce. The main area of focus

AI Finance

AI Stocks to Watch

As investor interest in artificial intelligence (AI) grows, many companies are highlighting their AI product plans. However, discovering AI stocks that already generate revenue from generative AI, such as OpenAI,

Web App Security

Web Application Supply Chain Security

Today’s web applications depend on a wide array of third-party components and open-source tools to function effectively. This reliance on external resources poses significant security risks, as malicious actors can

Thrilling Battle

Thrilling Battle: Germany Versus Huawei

The German interior ministry has put forward suggestions that would oblige telecommunications operators to decrease their reliance on equipment manufactured by Chinese firms Huawei and ZTE. This development comes after

iPhone 15 Unveiling

The iPhone 15’s Secrets and Surprises

As we dive into the most frequently asked questions and intriguing features, let us reiterate that the iPhone 15 brings substantial advancements in technology and design compared to its predecessors.

Chip Overcoming

iPhone 15 Pro Max: Overcoming Chip Setbacks

Apple recently faced a significant challenge in the development of a key component for its latest iPhone series, the iPhone 15 Pro Max, which was unveiled just a week ago.

Performance Camera

iPhone 15: Performance, Camera, Battery

Apple’s highly anticipated iPhone 15 has finally hit the market, sending ripples of excitement across the tech industry. For those considering upgrading to this new model, three essential features come

Battery Breakthrough

Electric Vehicle Battery Breakthrough

The prices of lithium-ion batteries have seen a considerable reduction, with the cost per kilowatt-hour dipping under $100 for the first occasion in two years, as reported by energy analytics

Economy Act Soars

Virginia’s Clean Economy Act Soars Ahead

Virginia has made significant strides towards achieving its short-term carbon-free objectives as outlined in the Clean Economy Act of 2020. Currently, about 44,000 megawatts (MW) of wind, solar, and energy

Renewable Storage Innovation

Innovative Energy Storage Solutions

The Department of Energy recently revealed a significant investment of $325 million in advanced battery technologies to store excess renewable energy produced by solar and wind sources. This funding will

Renesas Tech Revolution

Revolutionizing India’s Tech Sector with Renesas

Tushar Sharma, a semiconductor engineer at Renesas Electronics, met with Indian Prime Minister Narendra Modi to discuss the company’s support for India’s “Make in India” initiative. This initiative focuses on

Development Project

Thrilling East Windsor Mixed-Use Development

Real estate developer James Cormier, in collaboration with a partnership, has purchased 137 acres of land in Connecticut for $1.15 million with the intention of constructing residential and commercial buildings.

USA Companies

Top Software Development Companies in USA

Navigating the tech landscape to find the right partner is crucial yet challenging. This article offers a comparative glimpse into the top software development companies in the USA. Through a

Software Development

Top Software Development Companies

Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in and explore the leaders in

India Web Development

Top Web Development Companies in India

In the digital race, the right web development partner is your winning edge. Dive into our curated list of top web development companies in India, and kickstart your journey to

USA Web Development

Top Web Development Companies in USA

Looking for the best web development companies in the USA? We’ve got you covered! Check out our top 10 picks to find the right partner for your online project. Your

Clean Energy Adoption

Inside Michigan’s Clean Energy Revolution

Democratic state legislators in Michigan continue to discuss and debate clean energy legislation in the hopes of establishing a comprehensive clean energy strategy for the state. A Senate committee meeting

Chips Act Revolution

European Chips Act: What is it?

In response to the intensifying worldwide technology competition, Europe has unveiled the long-awaited European Chips Act. This daring legislative proposal aims to fortify Europe’s semiconductor supply chain and enhance its