Using SOAP HTTP Transport Headers

This sample shows how to use SOAP Transport headers received on the service side. The service publishes the transport header elements for two operations.

Procedure

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

Result

For getCityInfoTest, you see the information corresponding to the zip code that is defined in the zip field. Its default value is 61801, which returns information about Urbana IL.

For getCityInfoTestHeaders, you see the information corresponding to the distance between two zip codes. The default values are 61801 for Urbana IL and 61820 for Champaign IL.

HTTP Transport Headers from the client side are captured along with input data on the service side. Transport Headers parameters are saved on service side.

The file specified for the OUTPUT_FILE property is written with the following contents:

HTTP Transport Header elements for operation CityInfo:

method: POST

requesturi: /SOAPServiceBinding/zipPort/

httpversion: 1.1

querystring:

protocol: HTTP/1.1

port: 11005

Header->accept:

Header->accept-charset:

Header->accept-encoding: Header->content-type: text/xml; charset=UTF-8

content-length: 167

connection:

cookie:

pragma:

HTTP Transport Header elements for operation CityDistance:

method: POST

requesturi: /SOAPServiceBinding/zipPort/

httpversion: 1.1

querystring:

protocol: HTTP/1.1

port: 11005

Header->accept:

Header->accept-charset:

Header->accept-encoding: Header->content-type: text/xml; charset=UTF-8

content-length: 360

connection:

cookie:

pragma:

Understanding the Configuration

This sample implements a service to determine the information about the zip codes along with passing the HTTP Transport parameters using the context resource. 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).

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. HTTP Transport Headers are captured on the service side using the Context activities.

Both operations are invoked from the client side with a small sleep between invocations. HTTP Transport Headers details from client side are captured as an output on the service side.