The JavaTM Web Services Tutorial
Home
TOC
PREV TOP NEXT

Using the JAXR API to Access the Registry Server

You can access the Registry Server by using the sample programs in the docs/tutorial/examples/jaxr directory (on UNIX systems) or the docs\tutorial\examples\jaxr directory (on Microsoft Windows systems). For details on how these examples work and how to run them, see Running the Client Examples.

You need to edit the examples as follows.

  1. Edit the following lines in the main method of each source file to specify the Registry Server. For both the queryURL and the publishURL, comment out all but the Registry Server line. (By default, the IBM registry is specified.) When you finish, the lines should look something like this:
       String queryURL = 	
           //"http://www-
    3.ibm.com/services/uddi/v2beta/inquiryapi";	
           //"http://uddi.rte.microsoft.com/inquire";	
           // For Registry Server, replace <YourHost> with fully	
           //  qualified host name or localhost	
            "http://localhost:8080/registry- 
    server/RegistryServerServlet";	
       String publishURL = 	
           //"https://www-
    3.ibm.com/services/uddi/v2beta/protect/publishapi";	
           //"https://uddi.rte.microsoft.com/publish";	
           // For Registry Server, replace <YourHost> with fully	
           //  qualified host name or localhost	
            "http://localhost:8080/registry-
    server/RegistryServerServlet";
     
    
    If the Registry Server is running on a system other than your own, specify the fully qualified host name instead of localhost. Do not use https: for the publishURL.
  2. In the JAXRPublish and JAXRDelete source files, edit the lines in the main method that specify a user name and password by providing valid values. For example, you can specify the default user name and password, testuser:
       // Edit to provide your own username and password	
       String username = "testuser";	
       String password = "testuser";
     
    
  3. If the following lines in the makeConnection method of each source file do not contain empty strings (that is, if you previously edited them to access an external registry), edit them so that the strings are empty. You do not use a proxy to access the Registry Server.
       String httpProxyHost = "";	
       String httpProxyPort = "";	
       String httpsProxyHost = "";	
       String httpsProxyPort = "";
     
    
    The JAXRQuery example has only the first two of these lines, because it does not use an HTTPS proxy.
  4. In JAXRQuery.java, remove the percent (%) signs from the following line:
       namePatterns.add("%" + qString + "%");
     
    
    Instead, specify the namePatterns for the query string as follows:
       namePatterns.add(qString);
     
    
    The inability to use the percent sign to indicate that a string can occur anywhere in a name is a current limitation of the Registry Server.
  5. Feel free to change any of the organization data in the JAXRPublish source file.
  6. If you modify the business name in JAXRPublish, edit the following line in the main method of JAXRDelete to specify the beginning of your business name:
       String busNameString = "The Coffee";
     
    
Home
TOC
PREV TOP NEXT