Constructing a UDDI Client, Calling the UDDI Registry (cont.)

Implementing UDDI's Find Qualifiers
Each of UDDI's Find Qualifiers is a separate findQualifier tag, all of which are bundled together in a findQualifiers parent tag. Here's the complete FindQualifiers structure extracted from Listing 3:
<findQualifiers>
        <findQualifier>exactNameMatch</findQualifier>
        <findQualifier>caseSensitiveMatch</findQualifier>
        <findQualifier>sortByNameAsc</findQualifier>
        <findQualifier>sortByNameDsc</findQualifier>
        <findQualifier>andAllKeys</findQualifier>
        <findQualifier>sortByDateAsc</findQualifier>
        <findQualifier>sortByDateDsc</findQualifier>
  </findQualifiers>

Listing 1 shows the inner class FindQualifiers containing seven static integer variables, one against each qualifier. This class also has an Element named findQualifier. The AddQualifier() method takes an integer as an argument and adds a new Element to the parent findQualifier. By calling this method with different integer values, you set these qualifiers inside the main findQualifier Element. Each integer value corresponds to a different qualifier. The GetFindQualifiers() method returns the complete constructed and populated FindQualifiers element.

Contacting the UDDI Registry
The find_Business XML structure is passed to the findBusiness() method of the UddiClient class along with a UDDI URL and a port number, which are hard-coded in the sample code. I tested this implementation against IBM's UDDI registry, which is why its address is used as a hard-coded value. Because the UddiClient is reusable, this hard coding is done only at the GUI level.

 
Figure 2. Here's the sequence of events followed when you invoke UDDI's find_business method.

The SoapTransport class (Listing 7) sends the XML structure to the specified URL and receives its response. Internally, this class uses the SoapCall and HttpConnection classes (both in Listing 8). The SetBody() method of SoapTransport sets the given XML inside the SoapCall. The send(,) method of this class sends the complete SOAP message to its destination. The SoapCall class is a small footprint implementation of SOAP. It builds the SOAP ENVELOPE and BODY tags.

The FindBusiness() method of the UDDIClient class handles all functionality required by the corresponding method of UDDI's Inquiry API internally. It hides all the SOAP and HTTP details from the user. The FindBusiness() method returns a BusinessList class object instance (see Listing 2). The returned BusinessList object returned contains all the information that the UDDI registry sends back in response to findBusiness call.


The UDDI Client The UDDI Registry Replies

In this Article
Introduction Implementing UDDI's Find Qualifiers
The UDDI Client The UDDI Registry Replies
 





FEATURE SOFTWARE:
dtSearch Web
Add power searching to your web site.
Buy Now!

Encrypt It
Encrypt and Decrypt Data, Passwords and Files within your application.
Buy Now!

Standards Organizations and Web Service Coalitions

Key Platforms

Pure-Play Web Services Vendors

Web Service Technologies or Components

From Sun.com

For Further Reading

Discussion Groups
Java Web Services
.NET Web Services

Back to the Special Report

Java Zone

2001 Special Report: Judging Java

TALK BACK
UDDI is a critical part of the "killer app" of XML Web services. Do you think it's too complicated? Will the standard evolve? Will it become simpler? Should Sun support UDDI as an integral component of J2EE, or is it too soon to tell? Do you think the current UDDI implmentation is a victim of committee development? Let us know in the Java Web Services discussion group.


Sponsored Links

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map
Jupiterweb networks

internet.comearthweb.comDevx.comClickZ

Search Jupiterweb:

Jupitermedia Corporation has four divisions:
JupiterWeb, JupiterResearch, JupiterEvents, and JupiterImages

Copyright 2004 Jupitermedia Corporation All Rights Reserved.
Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Jupitermedia Corporate Info | Newsletters | Tech Jobs | E-mail Offers

Copyright Information/Privacy Statement