2

I have a spring integration application (outbound soap gateway). It calls a 3rd party SOAP web service which exposes multiple SOAP actions. How can I specify SOAP action dynamically or map it to different API call in the Spring gateway so that I don't have to rewrite channels/spring integration logic for every action.

I have search for examples and have a hunch that manipulating header-enricher might be useful here. But I am unable to find a specific example for it or if it is the right thing to do.

My environment is Java6, Spring Integration 4.2.0

Any help would be appreciated!

J. Doe
  • 21
  • 3

1 Answers1

0

To be honest your explanation isn't clear at a glance.

Since you mention SOAP_ACTION and header-enricher, I only can suggest something like this:

<header-enricher input-channel="expressionInput">
    <soap-action expression="@soapActionProvider.getSoapAction(payload)"/>
</header-enricher>

where soapActionProvider is some bean which is responsible to return an appropriate value for the SOAP_ACTION header according to the accepted payload of request message.

The logic may be any complexity there.

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118
  • Thanks for the reply. I have updated my question. All I want is to call multiple soap actions from an outbound gateway using the same integration chain. In your solution, how can i know which gateway method was called (as every gateway method will correspond to different soap action). – J. Doe Oct 09 '15 at 20:41
  • 1
    ??? Which gateway methods? The `` just implements `MessageHandler` and deals with something like XML in the SOAP style from the `payload`. Your new info makes me more blind. Please, share the configuration on the matter and point me out what you don't like there. – Artem Bilan Oct 09 '15 at 20:45