Implementing a JMS Service that Returns Information Based on Zip Codes

The JMS service returns information about a city, given a zip code. It also provides the distance between two cities as defined by their zip codes.

Prerequisites

TIBCO Enterprise Message Service must be running.

Procedure

  1. In the samples directory, select binding > soap > jms > ZipCodeLookup and double-click tibco.bw.sample.binding.soap.jms.ZipCodeLookup. For more information, see Accessing Samples.
  2. In Project Explorer expand the tibco.bw.sample.binding.soap.jms.ZipCodeLookup project.
  3. Set the default ApplicationProfile to match the OS you are running on. For more information, see Setting the Default Application Profile.
  4. Fully expand the Processes directory and double-click ZipInfoService.bwp.
  5. Verify your TIBCO Enterprise Message Service connection.
    1. Fully expand the Resources directory.
    2. Double-click JMSConnectionResource.jmsConnResource.
    3. In the Basic Configuration dialog box, click the Test Connection button to verify the connection.
  6. Click Run > Debug Configurations.
  7. At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
  8. Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the check box next to tibco.bw.sample.binding.soap.jms.ZipCodeLookup.application.
  9. Click Debug.
    This runs the sample in Debug mode.
  10. In TIBCO Business Studio™ for BusinessWorks™, click the Terminate icon to stop the process.

Result

For the getCityInfo service, information corresponding to the zip code defined in the zip field is returned. The default value is 61801, which returns information about Urbana, IL.

For the getCityDistance service, information corresponding to the distance between two zip codes is returned. The default values are 61801 for Urbana IL and 61820 for Champaign IL.

Understanding the Configuration

The project contains the ZipInfoService process that provides city information about a zip code. JMS is used for the transport. The project represents a simple JMS based service using SOAP. The getCityDistance and getCityInfo operations are implemented in the ZipInfoService process.