CentraSite Documentation : CentraSite Developer's Guide : Access via UDDI : UDDI V3 APIs : Examples : Getting the Value of an Attribute
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");
Copyright © 2005-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback