Web services take float with JAXR

Use JAXR to find and register Web services

1 2 3 Page 3
Page 3 of 3

Only capability-level 1 JAXR providers support internal taxonomies (internal ClassificationSchemes). Internal classification schemes are defined as a Concept hierarchy. When a registry stores classification information internally, it can perform validation whenever it classifies a registry object. External classifications don't offer that capability; instead of Concepts, they rely on String values to build a hierarchy under a classification scheme. Figure 7 illustrates a travel-related industry taxonomy based on the North American Industry Classification System (NAICS).

Figure 7. Internal and external classifications in a JAXR registry. Click on thumbnail to view full-size image.

The following code segment adds Magellan Travel to Web service registries via JAXR. After creating the organization, JAXR classifies Magellan as a travel agency, or code 56151 according to the NAICS (an external taxonomy):

try {
     Organization org =
          businessLifeCycleManager.createOrganization("Magellan Travel");
     InternationalString str =
          businessLifeCycleManager.createInternationalString("A cruise ship reservation system");
     //Primary contact
     User primaryContact = businessLifeCycleManager.createUser();
     PersonName pName = businessLifeCycleManager.createPersonName("Fernando Magellan");
     TelephoneNumber tNum = businessLifeCycleManager.createTelephoneNumber();
     Collection phoneNumbers = new ArrayList();
     EmailAddress emailAddress =
     Collection emailAddresses = new ArrayList();
     //Assign classification scheme
     ClassificationScheme sc =
     Classification classification =
            "Travel Agencies", "56151");
     Collection classifications = new ArrayList();
     //Save new organization
     Collection orgs = new ArrayList();
     BulkResponse response = businessLifeCycleManager.saveOrganizations(orgs);
     Collection exceptions = response.getException();
     if (exceptions == null) {
          System.out.println("Organization saved");
      } else {
          for (Iterator iterator = exceptions.iterator(); iterator.hasNext();) {
              JAXRException e = (JAXRException) iterator.next();
           System.out.println("Couldn't save organization.");
} catch (JAXRException e) {

The final code example finds all companies belonging to the deep-sea passenger transportation industry (or code 483112 in the NAICS taxonomy):

try {
     //Searching by classification
     String schemeName = "uddi-org:types";
     ClassificationScheme uddiOrgType =
     Classification classification =
          "Deep sea passenger transportation", "483112");
     Collection classifications = new ArrayList();
     BulkResponse res = businessQueryManager.findOrganizations(
     Collection orgs = res.getCollection();
     Iterator it = orgs.iterator();
     while (it.hasNext()) {
          Organization o = (Organization)it.next();
          System.out.println("Organization name: " + o.getName().getValue());
} catch (JAXRException e) {

Additional benefits

The JAXR API has several additional capabilities Magellan Travel will find useful, including context-aware classifications. Consider a cruise line that classifies itself via a geographic taxonomy under Japan. From that information alone, you cannot tell whether the cruise line offers trips to Japan, operates ships inside Japan, or has its fleet under Japanese registration. By adding an extra link and classifying that geographic classification itself, you easily clarify this situation. (Recall that Classification is just another RegistryItem; thus, you can call addClassification() on it too.)

Another important JAXR feature lets you create associations between registry objects. If a cruise line has partner arrangements with local vendors, for instance, Magellan Travel would consider those pre-existing relationships when making business arrangements. Figure 8 shows how a JAXR-based registry browser displays those business associations.

Figure 8. A JAXR registry browser displaying registry object associations, showing how companies associate in a business relationship. Click on thumbnail to view full-size image.

Once Magellan Travel discovers a cruise line of interest, it would like to initiate a business relationship with that company. In my next column, I will focus on how the Web service specifications and access URIs published in registries lets Magellan's programmers make remote method invocations to a newly discovered cruise company's Web service via JAX/RPC (Java API for XML-based RPC).

Learn more about this topic

1 2 3 Page 3
Page 3 of 3