CentraSite Documentation : CentraSite Developer's Guide : Access via UDDI : UDDI V3 APIs : Examples : Inquiring about a Business Service
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());
Copyright © 2005-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback