Developing Web Services with Java APIs for XML Using WSDP

In the section, Using the Default Registry, we explained how the Registry Browser can be used for adding an organization to the registry. In this section, we perform the tasks of adding/deleting an organization to/from the registry and modifying existing records using JWSDP classes. We use IBM s test registry in the examples given in this section.
We again begin by making a connection to the registry using the connection() method. (Please refer to the section, Connecting to a Registry, to review how the connection() method works.) The first step in creating an organization is providing a username and password to the registry for authentication. The authentication information is used to set the credentials for the connection object as shown in the following code snippet:
String username = "Yash1";String password = "yashraj1";<a name="738"></a><a name="beginpage.BF51C766-E111-4318-976E-F4B53708FEFE"></a>PasswordAuthentication userdetail;userdetail = new PasswordAuthentication (username, passw.toCharArray());Set user = new HashSet();user.add(userdetail);connection.setCredentials(user);
Recollect from the discussions in the Using the Default Registry section that you need to create an IBM UDDI Account to obtain the username and password.
Next, we create a business life cycle manager to create an organization that we can submit to the registry:
BusinessLifeCycleManager blmanager;blmanager = myservice.getBusinessLifeCycleManager();
We use a BusinessLifeCycleManager object since it provides methods that are required to set the necessary information pertaining to an organization, as will be clear from the following discussions.
We use the createOrganization() method of the business life cycle manager to create an Organization object...