Skip to content

Web Services with Soap Headers

Overview

Soap headers are an optional part of any SOAP message. If one exists, the header contains information about the message, or about the context in which the message is sent, or basically whatever the creator of the message thought was a good idea to put there instead of the actual body of the message. Neuron ESB can easily handle the inclusion of Soap headers in the messages it processes. These Soap headers can be added to the message by the Web client, they can be added to the response by the Web service, or they can be added by Neuron ESB when its acting as a service intermediary.

Running the Sample

Open the Sample

To open this sample, see the topic Using the Neuron Samples and select the Soap Headers sample.

Configure the Sample

When launching this sample from the Samples Explorer, a Visual Studio project with two Web services, a Web client and a Soap Header project is opened along with the Neuron ESB Solution. This project needs to be configured to start all three console applications and built. Then the Soap Header assembly needs to be copied to the Neuron program files directory.

  1. Configure the Visual Studio Solution to have multiple startup projects and to start these three projects at the same time: SoapHeaderClient, SoapHeaderServiceV1 and SoapHeaderServiceV2.
  2. Build the solution.
  3. Copy the SoapHeaders.dll assembly from the project build location (C:\Program Files\Neudesic\Neuron ESB v3\Samples\Services\SoapHeaders\SoapHeaders\bin\Debug) to the Neuron ESB v3 installation directory (C:\Program Files\Neudesic\Neuron ESB v3\DEFAULT).
  4. Restart the Neuron ESB Service either with the Neuron ESB Explorer or the Services MMC.

Run the Sample

  1. Start the Visual Studio projects by pressing F5.
  2. Three console apps will start. Wait for the two SoapHeaderService.exe console applications to say that they are listening for service requests. Select the console app that states Press ENTER to call the Neuron Soap Header Services (the SoapHeaderClient application) and press ENTER.
    The SoapHeaderClient application
    Figure 1: The SoapHeaderClient application
    1. First, the client application calls the Neuron Client Connector RouteByAction with the Action = V1. This routes the service call to the EchoHRService_V1 Service connector.
    2. Second, the client application calls the Neuron Client Connector RouteByAction with the Action = V2. This routes the service call to the EchoHRService_V2 Service connector.
    3. Third, the client application calls the Neuron Client Connector RouteByHeader using a simple Soap header. This routes the service call to the EchoHRService_V1 Service connector.
    4. Finally, the client application calls the Neuron Client Connector RouteByHeader using a custom Soap header. This routes the service call to the EchoHRService_V2 Service connector.
Figure 2: The SoapHeaderServiceV1 console window after receiving the request
Was this article helpful?
Dislike 0
Previous: Securing Client Connectors with OAuth Sample
Next: Transport Samples