Using SOAP Bound Headers

This sample shows how to use SOAP Bound Headers by passing any data or control information in the SOAP envelope. In this sample the Input WSDL message part is configured as a Header in the WSDL definition.

Procedure

  1. In the samples directory, select binding > soap > http > SOAPBoundHeaders and double-click tibco.bw.sample.binding.soap.http.SOAPBoundHeaders. For more information, see Accessing Samples .
  2. In the Project Explorer expand the tibco.bw.sample.binding.soap.http.SOAPBoundHeaders 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 Client.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.SOAPBoundHeaders.application
  8. Click Debug.
    This runs the sample in the Debug mode.
  9. In TIBCO Business Studio™ for BusinessWorks™, click the Terminate icon to stop the process.

Result

The expected outcome for the file identified in the OUTPUT_FILE property is similar to the following console output:

10:41:08.248 INFO [bwThread:In-Memory STWorkProcessor-2] c.t.b.p.g.L.t.b.s.b.s.h.S.Log - Invoked cityinfo

10:41:08.273 INFO [bwThread:In-Memory STWorkProcessor-3] c.t.b.p.g.L.t.b.s.b.s.h.S.Log - CityInfo response:

city: Urbana

state: Illinois

location: Urbana, Illinois, United States

latitude: 40.11

longitude: 88.207

zip: 61801

10:41:10.299 INFO [bwThread:In-Memory STWorkProcessor-5] c.t.b.p.g.L.t.b.s.b.s.h.S.Log1 - Invoked cityDistance

10:41:10.306 INFO [bwThread:In-Memory STWorkProcessor-6] c.t.b.p.g.L.t.b.s.b.s.h.S.Log1 - CityDistance response:

Distance from cityUrbana to city Champaign is 4

Understanding the Configuration

This sample implements a service for determining information about the zip codes. This includes getting information for the city at the specified zip code, and for getting the distance between two cites (defined by their zip codes). CityInfo operation input message is configured as SOAP Header data whereas the CityDistance operation input message is configured as SOAP Body data.

Two operations are implemented in the server process. The service operations getCityInfo and getCityDistance provide a means for getting the city information about a zip code and distance between the cities. Both operations are invoked from the client side with a small sleep between invocations.