Implementing a JMS Service that Returns Information Based on Zip Codes

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

Prerequisites

  • TIBCO Enterprise Message Service must be running.
  • Ensure the queues jmsbasic.queue and reply.queue have been created.

Testing Locally

Procedure

  1. In the samples directory, select select binding > soap > jms > ZipCodeLookup and double-click tibco.bwce.sample.binding.soap.jms.ZipCodeLookup. See Accessing Samples for more information.
  2. From the Project Explorer expand the tibco.bwce.sample.binding.soap.jms.ZipCodeLookup project.
  3. Set the default ApplicationProfile to match the OS you are running on. See Setting the Default Application Profile.
  4. Expand the Processes directory and double-click ZipInfoService.bwp.
  5. Verify your TIBCO Enterprise Message Service connection.
    1. Expand the Resources directory.
    2. Double-click JMSConnectionResource.jmsConnResource.
      Click the Test Connection button to verify the connection.
  6. Click File > Save
  7. Click Run > Debug
  8. From the Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
  9. Click the Applications tab and then click the Deselect All button if you have multiple applications.
  10. Select the checkbox next to tibco.bwce.sample.binding.soap.jms.ZipCodeLookup.application.
  11. Click Debug.
    The sample now runs in the debug mode.
  12. Click the Terminate icon when you have completed using the listed operations.

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.