Search code examples
soapspring-integrationspring-ws

Does SOAP Action remain the same when performing successive calls from Spring Integration?


I have developed a route with Spring Integration. In this route we receive a JSON payload through an inbound-gateway, perform some transformations and routing along the way and make three successive SOAP calls (to Tibco AMX BPM) using int-ws:outbound-gateway's. Each outound-gateway has an int-ws:header-enricher just before it to set the SOAP action:

<int-ws:header-enricher input-channel="getWorkListItemsRequest1" output-channel="getWorkListItemsRequest2">
    <int-ws:soap-action value="getWorkListItems" />
</int-ws:header-enricher>

While debugging an unexpected behavior of the application in a new environment, we traced the SOAP calls including HTTP headers and discovered that the SOAP action header is set correctly for the first call then remains the same for the next two calls (the system behaves as if the second and third header-enricher's were ignored).

Is there anything I'm obviously missing or misunderstanding?

Thanks in advance


Solution

  • You need to set the overwrite flag...

    <int-ws:header-enricher input-channel="getWorkListItemsRequest1" output-channel="getWorkListItemsRequest2">
        <int-ws:soap-action value="getWorkListItems" overwrite="true" />
    </int-ws:header-enricher>
    

    or

    <int-ws:header-enricher input-channel="getWorkListItemsRequest1" output-channel="getWorkListItemsRequest2"
             default-overwrite="true">
        <int-ws:soap-action value="getWorkListItems" />
    </int-ws:header-enricher>