You are on page 1of 2

Programming Steps for Publishing Information to a UDDI Registry

1. Construct the UDDIApiPublishing object. This is the object that is used to actually publish to
the registry.
UDDIApiPublishing objUDDIApiPublishing =
UDDILookup.getPublishing(“https://localhost/wasp/uddi/publishing/”);

2. Get hold of the authentication token from the registry with the help of the get_authToken()
API call on the UDDIApiPublishing object. Once we have the authentication token, we should
be able to publish to the registry.
AuthToken objAuthToken = objUDDIApiPublishing.get_authToken (new GetAuthToken(
new UserID(“registry_user”), new Cred(“registry_user”)));

3. Create the BusinessEntity structure and populate it with the name and description of the
business to submit. Note that we do not have to create the key for this business because the
registry, upon submitting the business information, would generate it.
BusinessEntity objBusinessEntity = new BusinessEntity();
objBusinessEntity.addName(new Name(sBusinessName));
objBusinessEntity.addDescription(new Description(sBusinessDescription));

4. Now, get hold of the SaveBusiness object. This object represents a collection of businesses
that we wish to submit at a time. Hence, we will need to add the BusinessEntity object that we
just created to the SaveBusiness object using the addBusinessEntity() method.
SaveBusiness objSaveBusiness = new SaveBusiness();
objSaveBusiness.addBusinessEntity(objBusinessEntity);

5. Now, publish the business information through a save_business() call on UDDIApiPublishing


object. This method call takes the SaveBusiness object as an argument and returns the
BusinessDetail object upon completion.
BusinessDetail objBusinessDetail =objUDDIApiPublishing.save_business(objSaveBusiness);

6. After the publishing operation has been executed, discard the authentication token. Finally,
check whether the publishing operation was successful or not.
objUDDIApiPublishing.discard_authToken(new DiscardAuthToken(objAuthToken));
Searching Information in a UDDI Registry
1. Construct the FindBusiness object. This object represents the criteria for the search operation.
Hence, we will need to add our criteria, that is, the name pattern that the user supplied, using
the addName() method on this object.
FindBusiness objFindBusiness = new FindBusiness();
objFindBusiness.addName(new Name(sNameOfBusiness));

2. Construct the UDDIApiInquiry object that we would use for placing the inquiry call.
UDDIApiInquiry objUDDIApiInquiry = UDDILookup.getInquiry(“localhost/ wasp/uddi/inquiry/”);

3. Finally, invoke the business inquiry operation through the find_business() method on the
UDDIApiInquiry object. This method returns a BusinessList object containing the BusinessInfo
structures.
BusinessList objBusinessList = objUDDIApiInquiry.find_business(objFindBusiness);

4. Now, check whether the businesses are found matching the given criteria. If there are matching
businesses, we need to traverse through their BusinessInfo structures and get hold of the name and
key UUID of the business.
BusinessInfos objBusinessInfos = objBusinessList.getBusinessInfos();

You might also like