| |

Lesson 5: Getting details on a business

Lesson objective

The objective of this lesson is to learn how to get the details on a business in an UDDI registry.

Reference material

Source code of reference: GetBusinessDetailExample.java

Related lessons

This lesson is a follow on to lesson 2, "Finding a business".

Review of concepts

The UDDI Programmer's API defines the messages to be used to find information from an UDDI registry. Among them, the find_business message allows finding high-level information on a business. The UDDI registry reply is a businessList message. More detailed information on a business can then be obtained, if needed, using a get_businessDetail call studied in this lesson.

Code snippets

We first create an UDDIProfile and set, in this example, the inquiry URL to Microsoft's UBR. We will also use UDDI 2.0 for the interactions with the UDDI registry:

UDDIProfile profile = new UDDIProfile();

profile.setProperty("inspireit.uddi.inquiry.url","http://uddi.microsoft.com/inquire");

profile.setProperty("inspireit.uddi.version","2.0");

An UDDIQuerier to query the UDDI registry can be instantiated using the static getQuerier(UDDIProfile) method:

UDDIQuerier querier = UDDIQuerier.getQuerier(profile);

UDDIQuerier comes with a set of methods to search detailed information on businesses stored in an UDDI registry. We need the keys of these business entities, what we can obtained using the various findBusiness() methods.

BusinessKey businessKey = ...

BusinessDetail businessDetail = querier.getBusinessDetail(businessKey);

The UDDIQuerier methods all throw RemoteException and UDDIException , not catched here for clarity. The returned BusinessDetail can be further decomposed at the required level of granularity.

BusinessEntitys businessEntitys = businessDetail.getBusinessEntitys();

BusinessEntity _businessEntitys[] = businessEntitys.toArray();

for(int i=0; i< _businessEntitys.length; i++) {

BusinessEntity businessEntity = _businessEntitys[i];

Names names = businessEntity.getNames();

System.out.println("BusinessEntity #" + i + ": " + (names.toArray())[0]);
}

 

| |

(c) INSPIRE IT, 2003 | Send us your feedback: developers@ruddi.biz