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: org.systinet.uddi.client.v1.InquireSoap
Demos: Inquiry demos v1
WSDL: publish_v1.wsdl
API endpoint: http://<host name>:<port>/uddi/publishing
Java API: org.systinet.uddi.client.v1.PublishSoap
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: org.systinet.uddi.client.v2.Inquire
Demos: Inquiry demos v2
Specification: Publishing API Function
WSDL: publish_v2.wsdl
API endpoint: http://<host name>:<port>/uddi/publishing
Java API: org.systinet.uddi.client.v2.Publish
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: org.systinet.uddi.client.v3.UDDI_Inquiry_PortType
Demos: Inquiry demos v3
Specification: Publication API set
API endpoint: http://<host name>:<port>/uddi/publishing
Java API: org.systinet.uddi.client.v3.UDDI_Publication_PortType
Demos: Publishing demos v3
Specification: Security API set
API endpoint: http://<host name>:<port>/uddi/security
Java API: org.systinet.uddi.client.v3.UDDI_Security_PortType
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: org.systinet.uddi.client.custody.v3.UDDI_CustodyTransfer_PortType
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: org.systinet.uddi.client.subscription.v3.UDDI_Subscription_PortType
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.
Vendors are permitted by UDDI V3 Specification to define new find qualifiers. BEA AquaLogic Service Registry comes with the following find qualifiers:
myEntities - The myEntities find qualifier restricts results of queries to entities which belong to the caller. Note that caller can not be anonymous, otherwise no entities are returned.
short name | myEntities |
tModel key | uddi:systinet.com:findQualifier:myEntities |
compatibility | find_business, find_service, find_binding, find_tModel |
foreignEntities - The foreignEntities find qualifier restricts result of queries to entities which do not belong to the caller. This find qualifier does not make any sense for an anonymous caller because all entities will be returned in the query.
short name | foreignEntities |
tModel key | uddi:systinet.com:findQualifier:foreignEntities |
compatibility | find_business, find_service, find_binding, find_tModel |
deletedTModels - If you use the deletedTModels find qualifier only hidden tModels are returned to the find_tModel. This is suitable for administrators to find garbage tModels to delete them permanently.
short name | deletedTModels |
tModel key | uddi:systinet.com:findQualifier:deletedTModels |
compatibility | find_tModel operation |
![]() | Note |
---|---|
When delete_tModel operation is performed over given tModel, it depends on Registry settings if the tModel is only hidden to all find_tModel operations (default behavior required by specification) or the tModel is really deleted (only if there is no dependency on the tModel). See Administrator's Guide, Node |