2

I am using spring integration to send requests to a web service endpoint (also configured using integration) using data generated by integration elements. There is a part in my workflow which I have to program myself. Usually I create a gateway object/interface, Autowire and use it to send/receive data from the integration workflow. I would like to do something similar but instead of using the generic gateway I would like to use the web service outbound gateway. Any ideas how to do this?

Samantha Catania
  • 5,116
  • 5
  • 39
  • 69

1 Answers1

2

As you noticed already the first class citizen is MessageChannel and the logic in the integration flow is based on the Message sending from one endpoint to another over those MessageChannels.

So, as you guess right now to send a request to the <int-ws:outbound-gateway> you should use its request-channel and send a Message<?> object to it. For this purpose the Framework provides for you a MessagingTemplate which you can use from you own code bypassing the gateway abstraction. And there is a convenient method on the matter - convertAndSend(). Also pay attention to the MessageBuilder utility to simplify your messaging life.

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118