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);