Invoking a SOAP over HTTP Web Service Using Different SOAP Versions

This sample shows implementation of a service for determining zip code information. This includes getting information for the city for the specific zip code and calculating distance between two cites defined by their zip codes.

The process provides city information based on a zip code, using HTTP as the transport. The service represents a simple HTTP based service using SOAP 1.1 and SOAP 1.2.

Prerequisites

Note: To run the sample you can either use TIBCO ActiveMatrix BusinessWorks™ 6.x client or ActiveMatrix BusinessWorks™ 5.x as a client.

Procedure

Configure the Server

  1. In the samples directory, select binding > soap > http > MixedSOAPVersions and double-click tibco.bw.sample.binding.soap.http.MixedSOAPVersions. For more information, see Accessing Samples.
  2. In Project Explorer, expand the tibco.bw.sample.binding.soap.http.MixedSOAPVersions project.
  3. Set the default application profile 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 Process.bwp.
  5. Click Run > Debug Configurations.
  6. At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
  7. 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.http.MixedSOAPVersions.application.
  8. Click Debug.
    The sample runs in Debug mode.

Configure the Client

  1. Unzip the TIBCO_HOME\bw\n.n\samples\bindings\soap\http\MixedSOAPVersions\bw5\tibco.bw.binding.soap.http.MixedSOAPVersionsClient.zip file to a directory.
  2. Start TIBCO Designer and open the unzipped project in the directory.
    1. In TIBCO Designer, click Global Variables and verify whether the variables are set correctly.
    2. Click theTester tab and then click the green button. Select the check box next to the process and then select Load & Start Current.
    3. After the process completes, click the Stop Testing icon to stop the process.
  3. In TIBCO Business Studio for BusinessWorks, click the Terminate icon to stop the process.

Result

  • For getCityInfoTest, the zip code defined in the zip field returns information about Urbana IL.
  • For getCityDistanceTest, the distance between two zip codes is returned.

The following output is visible in the console:

12:37:20.751 INFO [bwThread:In-Memory STWorkProcessor-3] c.t.b.p.g.L.t.b.s.b.s.h.M.Log - Invoked cityinfo

12:37:20.774 INFO [bwThread:In-Memory STWorkProcessor-4] c.t.b.p.g.L.t.b.s.b.s.h.M.Log - getCityInfo:

city: Urbanastate: Illinois

location: Urbana, Illinois, United States

latitude: 44.11

longitude: 88.207

zip: 61801

12:37:22.642 INFO [bwThread:In-Memory STWorkProcessor-6] c.t.b.p.g.L.t.b.s.b.s.h.M.Log1 - Invoked cityDistance

12:37:22.650 INFO [bwThread:In-Memory STWorkProcessor-7] c.t.b.p.g.L.t.b.s.b.s.h.M.Log -getCityDistance: 4

Understanding the Configuration

The server process has two operations implemented: getCityInfo and getCityDistance are used to return information, based on zip codes.

The operations implemented in the server process are invoked using the getCityDistanceTest and getCityInfoTest test processes from the client project developed in ActiveMatrix BusinessWorks 5.x.

  • The endpoint ConcreteZipInfo_SOAP1.1 using SOAP 1.1 implements getCityInfoTest.
  • The endpoint, ConcreteZipInfo_SOAP1.2 using SOAP 1.2 implements getCityDistance.