CentraSite Developer's Guide : Access Using UDDI : UDDI V3 APIs
UDDI V3 APIs
The CentraSite Registry or Repository supports the Java API for XML Registries (JAXR). It also supports UDDI V3- and V2. These APIs enable you to interact with the CentraSite Registry or Repository directly from UDDI-compliant browsers and integration development environment (IDE) tools. For more information about IDE tools, see Using Third-Party IDE Tools with CentraSite .
CentraSite provides Javadocs that you can use to create UDDI V3 clients. The Javadocs provide the interfaces you need for implementing the Publish, Inquiry, Security, and Taxonomy APIs in your clients.
<CentraSite_installation_root>\Documentation\en\jd\uddiv3ClientAPI
CentraSite supports the following APIs.
Use this API...
To enable the client to...
Publish
Execute any UDDI publishing API call. For example, you can publish services to CentraSite and publish proxy endpoints for services that already exist in CentraSite. You can publish the following UDDI objects: Organization, Service, ServiceBinding, and tModel.
Inquiry
Interrogate CentraSite to retrieve service information. When an active run-time policy’s virtual service executes, the Inquiry API pulls the virtual service's information from CentraSite. You can publish the following UDDI objects: Organization, Service, ServiceBinding, and tModel.
Security
Execute UDDI security API calls, using authorization tokens.
Taxonomy
Fetch taxonomies and their immediate children nodes. The taxonomies are represented in the tree structure. The Taxonomy API is a custom API.
Classes and Interfaces
The major classes and interfaces available in the Javadocs are described as follows:
RegistryService
RegistryService is the core interface to communicate with the UDDI Registry using the UDDI V3 API. This interface contains utility methods to get service stubs for the Publish, Inquiry, Security, and Taxonomy APIs. The UDDI operations are performed using their respective service stubs. It also contains a method to connect to the CentraSite Registry or Repository, using authentication tokens.
RegistryConfiguration
RegistryConfiguration is a bean class that is used to connect to the CentraSite Registry or Repository, based on the Registry or Repository’s configuration details, such as its host, port, and URLs. The URLs include the Security URL, Inquiry URL, Publish URL, and Taxonomy URL. This class also contains the user credentials of the Registry or Repository.
RegistryFramework
RegistryFramework is a helper interface that can be used to get attribute values, relationships and documents. This class contains the helper method getServiceModifiedDate, which uses get_operationalInfo to get the modified date of the service.
Note:  
Unlike the UDDI specification, serviceBinding is a contained element of a businessService entity in CentraSite. Thus, when a service's bindingTemplate entity is updated, then the service is updated as well. This means that when you use the helper method getServiceModifiedDate, it returns the same modification time for both the modified and modifiedIncludingChildren attributes.
RegistryAgent
RegistryAgent is an interface that enables a policy enforcement point to query the virtual services in the CentraSite Registry or Repository, and to publish run-time performance metrics to the CentraSite Registry or Repository.
This interface contains the following helper methods:
*findVirtualServices that finds the virtual services that are deployed to the runtime target
*getVirtualServiceWSDLURL that returns the WSDL URL for the specified virtual service
*saveMetrics that saves the run-time performance metrics for the virtual services
UDDI_Security_SoapService
UDDI_Security_SoapService is an interface that can be used for all UDDI Security operations. This interface contains the methods get_authToken and discard_authToken. An instance of this interface can be obtained from RegistryService.
UDDI_Inquiry_SoapService
UDDI_Inquiry_SoapService is an interface that contains methods for all Inquiry operations. An instance of this interface can be obtained from RegistryService.
UDDI_Publication_SoapService
UDDI_Publication_SoapService is an interface that contains methods for all UDDI Publish operations. An instance of this interface can be obtained from RegistryService.
UDDI_Taxonomy_SoapService
UDDI_Taxonomy_SoapService is an interface that uses the method get_conceptDetail to fetch taxonomies and their immediate children. The taxonomies are represented in the tree structure. An instance of this interface can be obtained from RegistryService.
CentraSiteBusinessService
CentraSiteBusinessService is a wrapper class for the BusinessService class. This class contains all methods contained in BusinessService, as well as these additional methods:
*getAttachedPolicyDocURL that returns the attached policy associated with the service.
*getAttachedPolicyTModelKey that returns the attached policy tModel key associated with the service.
*getAttributes that returns the attributes associated with the service in a Map.
*getDocuments that returns the documents associated with the service in a Map.
*getRelatedObjectKey that returns the UDDI key of the object that has the specified relationship.
Examples
Getting the Value of an Attribute
The following example shows how to get the value of an attribute named Life Cycle Status.
//Creating configuration object with host, port
//and user credentials of the registry
RegistryConfiguration regConfig =
new RegistryConfiguration("localhost", "53307",
"DefaultUser", "PwdFor_CS21");
 
//Creating registry service instance using the RegistryConfiguration
RegistryService regService =
RegistryService.Factory.newInstance(regConfig);
 
//connection is made (get_authToken will be issued to registry)
regService.connect();
 
//Inquiring the registry for the service using find_service call
 
UDDI_Inquiry_SoapService inquirySoapService =
regService.getInquirySoapService();
FindService findService = new FindService();
Name name = new Name();
name.setValue("UDDI Security Service");
findService.setName(new Name[] {name});
findService.setAuthInfo(regService.getAuthToken());
System.out.println("Name....."+ findService);
ServiceList serviceList = inquirySoapService.find_service(findService);
ServiceInfos serviceInfos = serviceList.getServiceInfos();
 
//Getting the service Key for the first service
ServiceInfo serviceInfo = serviceInfos.getServiceInfo(0);
String serviceKey = serviceInfo.getServiceKey();
 
//Getting the service detail
GetServiceDetail getServiceDetail = new GetServiceDetail();
getServiceDetail.setServiceKey(new String[] {serviceKey});
getServiceDetail.setAuthInfo(regService.getAuthToken());
ServiceDetail serviceDetail =
inquirySoapService.get_serviceDetail(getServiceDetail);
BusinessService businessService =
serviceDetail.getBusinessService(0);
 
//Creating instance of CentraSiteBusinessService
CentraSiteBusinessService csBusinessService = new
CentraSiteBusinessService(businessService);
 
//Getting the value for the attribute "Life Cycle Status"
String attributeValue =
csBusinessService.getAttributeValue("Life Cycle Status");
Getting the Proxy Services for a Specified Target
The following example shows how to get the proxy services for a specified target.
//Creating configuration object with host, port
//and user credentials of the registry
RegistryConfiguration regConfig =
new RegistryConfiguration("localhost",
"53307", "DefaultUser", "PwdFor_CS21");
 
//Creating registry service instance using the RegistryConfiguration
RegistryService regService =
RegistryService.Factory.newInstance(regConfig);
 
//connection is made (get_authToken will be issued to registry)
regService.connect();
 
//Getting the RegistryAgent instance using RegistryService
RegistryAgent registryAgent = regService.getRegistryAgent();
 
//Getting the ServiceInfos which will contain
//a list of the services deployed in the "Actional" target
ServiceInfos proxyServices =
registryAgent.findProxyServices("Actional");
Inquiring about a Business Service
The following example shows how to fetch the details of a business service, using the UDDI Inquiry API:
//RegistryConfiguration containing the host, port, userId and
//password to connect to registry
RegistryConfiguration regConfig =
new RegistryConfiguration("hostName", "port", "userId", "password");
 
//Creating the RegistryService using RegistryConfiguration
RegistryService regService =
RegistryService.Factory.newInstance(regConfig);
 
//connecting to registry. This method will fetch the AuthToken
//using get_authTokenAPI
regService.connect();
 
//Inquiring the registry for the service using find_service call
UDDI_Inquiry_SoapService inquirySoapService =
regService.getInquirySoapService();
 
//Constructing the find_service inquiry call
FindService findService = new FindService();
Name name = new Name();
name.setValue("UDDI Inquiry Service");
findService.setName(new Name[] {name});
 
//Issuing find_service inquiry call to
//CentraSite registry using UDDI_Inquiry_SoapService
ServiceList serviceList = inquirySoapService.find_service(findService);
ServiceInfos serviceInfos = serviceList.getServiceInfos();
 
//Getting the service Key for the first service
ServiceInfo serviceInfo = serviceInfos.getServiceInfo(0);
String serviceKey = serviceInfo.getServiceKey();
 
//Getting the service detail
GetServiceDetail getServiceDetail = new GetServiceDetail();
getServiceDetail.setServiceKey(new String[] {serviceKey});
getServiceDetail.setAuthInfo(regService.getAuthToken());
ServiceDetail serviceDetail =
inquirySoapService.get_serviceDetail(getServiceDetail);
BusinessService businessService =
serviceDetail.getBusinessService(0);
System.out.println("Fetched Service Name : " +
businessService.getName()[0].getValue());
Publishing a Business Service
The following example shows how to publish a business service, using the UDDI Publish API:
//RegistryConfiguration containing the host, port,
//userId and password to connect to registry
RegistryConfiguration regConfig =
new RegistryConfiguration("hostName", "port", "userId", "password");
 
//Creating the RegistryService using RegistryConfiguration
RegistryService regService =
RegistryService.Factory.newInstance(regConfig);
 
//connecting to registry. This method will fetch the
//AuthToken using get_authTokenAPI
regService.connect();
 
//Getting the UDDI_Publication_SoapService to publish the
//sample business service
UDDI_Publication_SoapService publishSoapService =
regService.getPublishSoapService();
 
//Constructing the save service call for sample business service
SaveService saveService = new SaveService();
BusinessService businessService = new BusinessService();
Name name = new Name();
name.setValue("Sample Business Service");
businessService.setName(new Name[] {name});
 
//Setting the auth token using the registry service
saveService.setAuthInfo(regService.getAuthToken());
saveService.setBusinessService(new BusinessService[] {businessService});
 
//Saving the business service using UDDI_Publication_SoapService
publishSoapService.save_service(saveService);
Fetching Taxonomies
The following example shows how to fetch taxonomies, using the Taxonomy API:
//RegistryConfiguration containing the host, port,
//userId and password to connect to registry
RegistryConfiguration regConfig =
new RegistryConfiguration("hostName", "port", "userId", "password");
 
//Creating the RegistryService using RegistryConfiguration
RegistryService regService =
RegistryService.Factory.newInstance(regConfig);
 
//connecting to registry. This method will fetch the
//AuthToken using get_authTokenAPI
regService.connect();
 
//Getting the taxonomy soap service which is used fetch the taxonomies
UDDI_Taxonomy_SoapService taxonomySoapService =
regService.getTaxonomySoapService();
 
//Constructing the get_conceptDetail request
GetConceptDetail getConceptDetail = new GetConceptDetail();
 
//Fetching the NAICS taxonomy
getConceptDetail.setConceptKey(new String[]
{"uddi:uddi.org:ubr:categorization:naics:1997"});
 
//Using UDDI_Taxonomy_SoapService we are fetching the
//taxonomies from CentraSite registry
ConceptDetail conceptDetail =
taxonomySoapService.get_conceptDetail(getConceptDetail);
Copyright © 2015- 2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback