UDDI (Universal Description Discovery and Integration) is set of Web service that supports the description and discovery of Web service providers, Web services and technical fingerprints of those Web service.
The UDDI API set can be split by typical use case into two parts. The Inquiry API set is used to locate and obtain details on entries in the UDDI registry. For example to find out endpoint of given web service. The publication API set is used to publish and update information in the UDDI registry.
This section will show you how to use the BEA AquaLogic Service Registry API. Examples are based on UDDI version 3 Specification.
To use Inquiry APIs you can follow these steps. The complete code fragment is shown in Example 1.
Get API implementation from stub
String url = "http://localhost:8080/uddi/inquiry"; UDDI_Inquiry_PortType inquiry = UDDIInquiryStub.getInstance(url);
Collect inquiry parameters
String serviceKey = "uddi:systinet.com:demo:hr:employeesList"; String tModelKey = "uddi:systinet.com:demo:employeeList:binding"; Find_binding find_binding = new Find_binding(); find_binding.setServiceKey(serviceKey); find_binding.addTModelKey(tModelKey); find_binding.setMaxRows(new Integer(10));
Call inquiry method
BindingDetail bindingDetail = inquiry.find_binding(find_binding);
Operate with inquiry result
ListDescription listDescription = bindingDetail.getListDescription(); if (listDescription != null) { int includeCount = listDescription.getIncludeCount(); int actualCount = listDescription.getActualCount(); int listHead = listDescription.getListHead(); System.out.println("Displaying " + includeCount + " of " + actualCount+ ", starting at position " + listHead); }
![]() | Note |
---|---|
If you get the java.lang.reflect.UndeclaredThrowableException exception, check whether BEA AquaLogic Service Registry is running. |
To use the publishing API, follow these steps. The complete code fragment is shown in Example 2.
Get API of security stub
String securityUrl = "http://localhost:8080/uddi/security"; UDDI_Security_PortType security = UDDISecurityStub.getInstance(securityUrl); String publishingUrl = "http://localhost:8080/uddi/publishing"; UDDI_Publication_PortType publishing = UDDIPublishStub.getInstance(publishingUrl);
Get authentication token
AuthToken authToken = security.get_authToken(new Get_authToken(userName, password)); String authInfo = authToken.getAuthInfo();
Create save object
String businessKey = "uddi:systinet.com:demo:it"; String serviceKey = ""; // serviceKey is optional int count = 1; String[] serviceNames = new String[count]; String[] languageCodes = new String[count]; languageCodes[0] = null; // can set an array of language codes serviceNames[0] = "Requests Service"; //service name String serviceDescription = "Saved by Example"; //service description BusinessService businessService = new BusinessService(); businessService.setBusinessKey(businessKey); if (serviceKey != null && serviceKey.length() > 0) businessService.setServiceKey(serviceKey); businessService.addName(new Name(serviceNames[0], languageCodes[0])); businessService.addDescription(new Description(serviceDescription)); Save_service save = new Save_service(); save.addBusinessService(businessService); save.setAuthInfo(authInfo);
Call publishing method
ServiceDetail serviceDetail = publishing.save_service(save);
Operate with publishing result
BusinessServiceArrayList businessServiceArrayList = serviceDetail.getBusinessServiceArrayList(); int position = 1; for (Iterator iterator = businessServiceArrayList.iterator(); iterator.hasNext();) { BusinessService service = (BusinessService) iterator.next(); System.out.println("Service " + position + " : " + service.getServiceKey()); System.out.println(service.toXML()); position++; }
Discard the authentication token
security.discard_authToken(new Discard_authToken(authInfo));
Example 1. FindBinding v3
// Copyright 2001-2005 Systinet Corp. All rights reserved. // Use is subject to license terms. package example.inquiry; import org.systinet.uddi.client.v3.UDDIInquiryStub; import org.systinet.uddi.client.v3.UDDI_Inquiry_PortType; import org.systinet.uddi.client.v3.struct.*; import java.util.Iterator; public class PrincipleFindBinding { public static void main(String args[]) throws Exception { //1. Get API implementation from stub String url = "http://localhost:8080/uddi/inquiry"; System.out.print("Using Inquiry at url " + url + " .."); UDDI_Inquiry_PortType inquiry = UDDIInquiryStub.getInstance(url); System.out.println(" done"); //2. Collect inquiry parameters String serviceKey = "uddi:systinet.com:demo:hr:employeesList"; String tModelKey = "uddi:systinet.com:demo:employeeList:binding"; Find_binding find_binding = new Find_binding(); find_binding.setServiceKey(serviceKey); find_binding.addTModelKey(tModelKey); find_binding.setMaxRows(new Integer(10)); //3. Call inquiry method System.out.print("Search in progress .."); BindingDetail bindingDetail = inquiry.find_binding(find_binding); System.out.println(" done"); //4. Operate with result ListDescription listDescription = bindingDetail.getListDescription(); if (listDescription != null) { int includeCount = listDescription.getIncludeCount(); int actualCount = listDescription.getActualCount(); int listHead = listDescription.getListHead(); System.out.println("Displaying " + includeCount + " of " + actualCount + ", starting at position " + listHead); } BindingTemplateArrayList bindingTemplateArrayList = bindingDetail.getBindingTemplateArrayList(); if (bindingTemplateArrayList == null) { System.out.println("Nothing found"); return; } int position = 1; for (Iterator iterator = bindingTemplateArrayList.iterator(); iterator.hasNext();) { BindingTemplate bindingTemplate = (BindingTemplate) iterator.next(); System.out.println("Binding " + position + " : " + bindingTemplate.getBindingKey()); System.out.println(bindingTemplate.toXML()); position++; } } }
Example 2. SaveService v3
// Copyright 2001-2005 Systinet Corp. All rights reserved. // Use is subject to license terms. package example.publishing; import org.systinet.uddi.InvalidParameterException; import org.systinet.uddi.client.v3.UDDIException; import org.systinet.uddi.client.v3.UDDIPublishStub; import org.systinet.uddi.client.v3.UDDISecurityStub; import org.systinet.uddi.client.v3.UDDI_Publication_PortType; import org.systinet.uddi.client.v3.UDDI_Security_PortType; import org.systinet.uddi.client.v3.struct.AuthToken; import org.systinet.uddi.client.v3.struct.BusinessService; import org.systinet.uddi.client.v3.struct.BusinessServiceArrayList; import org.systinet.uddi.client.v3.struct.Description; import org.systinet.uddi.client.v3.struct.Discard_authToken; import org.systinet.uddi.client.v3.struct.DispositionReport; import org.systinet.uddi.client.v3.struct.Get_authToken; import org.systinet.uddi.client.v3.struct.Name; import org.systinet.uddi.client.v3.struct.Save_service; import org.systinet.uddi.client.v3.struct.ServiceDetail; import javax.xml.soap.SOAPException; import java.util.Iterator; public class PrincipleSaveService { public static void main(String[] args) throws UDDIException, InvalidParameterException, SOAPException { String userName = "demo_john"; String password = "demo_john"; //1. Get API implementation from stub String securityUrl = "http://localhost:8080/uddi/security"; System.out.print("Using Security at url " + securityUrl + " .."); UDDI_Security_PortType security = UDDISecurityStub.getInstance(securityUrl); System.out.println(" done"); String publishingUrl = "http://localhost:8080/uddi/publishing"; System.out.print("Using Publishing at url " + publishingUrl + " .."); UDDI_Publication_PortType publishing = UDDIPublishStub.getInstance(publishingUrl); System.out.println(" done"); //2. Get authentication token System.out.print("Logging in .."); AuthToken authToken = security.get_authToken(new Get_authToken(userName, password)); System.out.println(" done"); String authInfo = authToken.getAuthInfo(); //3. Create save object String businessKey = "uddi:systinet.com:demo:it"; String serviceKey = ""; // serviceKey is optional int count = 1; String[] serviceNames = new String[count]; String[] languageCodes = new String[count]; languageCodes[0] = null; // can set an array of language codes serviceNames[0] = "Requests Service"; //service name String serviceDescription = "Saved by Example"; //service description BusinessService businessService = new BusinessService(); businessService.setBusinessKey(businessKey); if (serviceKey != null && serviceKey.length() > 0) businessService.setServiceKey(serviceKey); businessService.addName(new Name(serviceNames[0], languageCodes[0])); businessService.addDescription(new Description(serviceDescription)); Save_service save = new Save_service(); save.addBusinessService(businessService); save.setAuthInfo(authInfo); //4. Call publishing method System.out.print("Save in progress ..."); ServiceDetail serviceDetail = publishing.save_service(save); System.out.println(" done"); //5. Operate with publishing result BusinessServiceArrayList businessServiceArrayList = serviceDetail.getBusinessServiceArrayList(); int position = 1; for (Iterator iterator = businessServiceArrayList.iterator(); iterator.hasNext();) { BusinessService service = (BusinessService) iterator.next(); System.out.println("Service " + position + " : " + service.getServiceKey()); System.out.println(service.toXML()); position++; } //6. Discard authentication token System.out.print("Logging out .."); security.discard_authToken(new Discard_authToken(authInfo)); System.out.println(" done"); } }
The UDDI version 1 Specification has provided a foundation for next versions.
WSDL: inquire_v1.wsdl
API endpoint: http://<host name>:<port>/uddi/inquiry
Java API:
Demos: Inquiry demos v1
WSDL: publish_v1.wsdl
API endpoint: http://<host name>:<port>/uddi/publishing
Java API:
Demos: Publishing demos v1
The UDDI version 2 Specification has introduced many improvements of existing concepts and new features like service projections.
Specification: Inquiry API functions
WSDL: inquire_v2.wsdl
API endpoint: http://<host name>:<port>/uddi/inquiry
Java API:
Demos: Inquiry demos v2
Specification: Publishing API Function
WSDL: publish_v2.wsdl
API endpoint: http://<host name>:<port>/uddi/publishing
Java API:
Demos: Publishing demos v2
The UDDI version 3 Specification is a major step in providing industry standard for building and querying XML web services registries useful in both public and private deployments.
Specification: Inquiry API set
API endpoint: http://<host name>:<port>/uddi/inquiry
Java API:
Demos: Inquiry demos v3
Specification: Publication API set
API endpoint: http://<host name>:<port>/uddi/publishing
Java API:
Demos: Publishing demos v3
Specification: Security API set
API endpoint: http://<host name>:<port>/uddi/security
Java API:
The Custody and Ownership Transfer API is used to transfer UDDI structures between UDDI nodes and to change their ownership. One use case is when the publisher wishes to transfer responsibility for a selected UDDI structure to another user, typically after a business reorganization.
Specification: Custody and Ownership Transfer API Set
API endpoint: http://<host name>:<port>/uddi/custody
Java API:
Demos: Custody Demos
The Subscription API is a service that asynchronously sends notification to users who have registered an interest in changes to a registry. These users have a range of options in specifying matching criteria so that they receive only the information in which they are interested.
Specification: Subscription API Set
API endpoint: http://<host name>:<port>/uddi/custody
Java API:
Demos: Subscription Demos
UDDI Version 3 Extensions are Systinet extensions of the UDDI Version 3 Specification. The following data structures are used by APIs for the Registry Console and APIs that will be approved as official technical notes of the UDDI specification.
This structure is used by the Registry Console for performance enhancements. The structure is an extension of businessEntity, the added element is uddi:assertionStatusItem that points to the related businessEntity,
This structure is an extension of the businessInfo structure; the added element is uddi_ext:contactInfos.
This structure is an extension of the operationalInfo structure, the added element is uddi:name. The entityKeyV2 holds UDDI v2 key values.
This structure is used by ACL functionality. The added elements are uddi:serviceInfos and uddi:bindingTemplates that point to UDDI entities the user does not own but has privileges to modify.
This structure is an extension of serviceInfo. It is used by the web interface for performance enhancements. The added elements are uddi:description and uddi:bindingTemplates.
UDDI V3 Specification permits vendors to define new find qualifiers. Table 12, “Summary of Additional Find Qualifiers in BEA AquaLogic Service Registry ” summarizes the additional find qualifiers in BEA AquaLogic Service Registry and the find_xx operations that support them. See Inquiry for more information on inquiry API operations.
Each short name in Table 12, “Summary of Additional Find Qualifiers in BEA AquaLogic Service Registry ” links to a subsection that follows. Note that the tModel key is the short name prefixed with uddi:systinet.com:findQualifier:.
Table 12. Summary of Additional Find Qualifiers in BEA AquaLogic Service Registry
Short Name | Supporting Operations | ||||
---|---|---|---|---|---|
find_business | find_service | find_binding | find_tModel | find_relatedBusinesses | |
deletedTModels | ✓ | ||||
foreignEntities | ✓ | ✓ | ✓ | ✓ | |
keyNameMatch | ✓ | ✓ | ✓ | ✓ | ✓ |
myEntities | ✓ | ✓ | ✓ | ✓ | |
omitKeyNameMatch | ✓ | ✓ | ✓ | ✓ | ✓ |
omitKeyValueMatch | ✓ | ✓ | ✓ | ✓ | ✓ |
omitTModelKeyMatch | ✓ | ✓ | ✓ | ✓ | ✓ |
tModelKeyApproximateMatch | ✓ | ✓ | ✓ | ✓ | ✓ |
This find qualifier returns only hidden tModels, hence enabling administrators to locate and permanently delete garbage tModels.
Note that the registry settings determine whether delete_tModel:
just hides the tModel from find_tModel operations (default behaviour required by the specification);
really deletes the tModel, provided there are no dependencies on it;
See Administrator's Guide, Node.
tModel Key | uddi:systinet.com:findQualifier:deletedTModels |
Supporting Operations | find_tModel. |
This find qualifier restricts results to entities that do not belong to the caller.
![]() | Note |
---|---|
This qualifier does not make any sense for an anonymous caller because all entities will be returned in the query. |
tModel Key | uddi:systinet.com:findQualifier:foreignEntities |
Supporting Operations | All find_xx operations except find_relatedBusinesses. |
This find qualifier changes default rules for matching keyedReferences. By default keyNames are only compared when the General Keywords tModelKey is specified. This find qualifier enforces comparison of keyNames.
The keyNameMatch and omitKeyNameMatch findQualifiers are mutually exclusive.
tModel Key | uddi:systinet.com:findQualifier:keyNameMatch |
Supporting Operations | All find_xx operations. |
This find qualifier restricts results to entities that belong to the caller.
![]() | Note |
---|---|
This qualifier does not make any sense for an anonymous caller. All entities would be returned in that case. |
tModel Key | uddi:systinet.com:findQualifier:myEntities |
Supporting Operations | All find_xx operations except find_relatedBusinesses. |
This find qualifier changes default rules for matching keyedReferences. By default keyNames are only compared when the General Keywords tModelKey is specified. This find qualifier skips comparison of keyNames.
The keyNameMatch and omitKeyNameMatch findQualifiers are mutually exclusive.
tModel Key | uddi:systinet.com:findQualifier:omitKeyNameMatch |
Supporting Operations | All find_xx operations. |
This find qualifier changes default rules for matching keyedReferences. By default keyValues are compared. This find qualifier skips comparison of keyValues.
The omitKeyValueMatch and omitTModelKeyMatch findQualifiers are mutually exclusive.
tModel Key | uddi:systinet.com:findQualifier:omitKeyValueMatch |
Supporting Operations | All find_xx operations. |
This find qualifier changes default rules for matching keyedReferences. By default tModelKeys are compared. This find qualifier skips comparison of tModelKeys.
The omitKeyValueMatch and omitTModelKeyMatch findQualifiers are mutually exclusive.
tModel Key | uddi:systinet.com:findQualifier:omitTModelKeyMatch |
Supporting Operations | All find_xx operations. |
This find qualifier changes the default rules for matching keyedReferences. By default tModelKeys are compared without wildcards and case insensitively. This find qualifier enables a tModelKey in a query to include wildcards:
'%' interpreted as zero or more arbitrary characters;
'_' interpreted as an arbitrary character.
The behavior is similar to the approximateMatch find qualifier.
tModel Key | uddi:systinet.com:findQualifier:tModelKeyApproximateMatch |
Supporting Operations | All find_xx operations. |