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
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.