Spring Book – Chapter 20 – Spring Integration

Web Services

Spring Integration provides two ways by it supports web services as follows:

  • Invoking a web service by sending a message to a channel using an outbound web service gateway
  • Sending a message to a channel upon receiving a web service invocation using an inbound web service gateway

Spring Integration provided inbound and outbound gateways include support for adding an XML marshaller and provides both client and server support for web services. Spring Integration builds upon the Spring Web Services project and the required Maven dependencies for the Spring Integration web services gateways are as shown in Listing 22-81 below.

Listing 22-81. Maven dependency required

Listing 22-82 below shows configuration of main Spring Integration namespace and Web Service related namespace in the Spring configuration file (ws-integration-context.xml).

Listing 22-82. Spring Integration Namespace declaration

Listing 22-83 below shows configuring web service inbound gateway in the Spring configuration file. It also uses a marshaller and unmarshaller that will do the necessary marshaling and unmarshalling of the web service calls.

Listing 22-83. Configuring web service inbound gateway

Listing 22-84 below shows configuring web service outbound gateway in the Spring configuration file. Similar to inbound gateway shown in the previous code snippet, it also uses a marshaller and unmarshaller that will do the necessary marshaling and unmarshalling of the web service calls.

Listing 22-84. Configuring web service outbound gateway

Page Visitors: 12265

The following two tabs change content below.
Tomcy John

Tomcy John

Blogger & Author at javacodebook
He is an Enterprise Java Specialist holding a degree in Engineering (B-Tech) with over 10 years of experience in several industries. He's currently working as Principal Architect at Emirates Group IT since 2005. Prior to this he has worked with Oracle Corporation and Ernst & Young. His main specialization is on various web technologies and acts as chief mentor and Architect to facilitate incorporating Spring as Corporate Standard in the organization.
Tomcy John

Latest posts by Tomcy John (see all)

2 thoughts on “Spring Book – Chapter 20 – Spring Integration

  1. Hi,
    Thanks for this blog and information sharing!
    I have one question from Spring Integration. Just thought of checking with you.
    I have SimplewebserviceOutBoundGateway. I need to send a document / attachment to the webservice. How will i achieve that?
    This is my current gateway configuration:

    Please let me know, if you can throw some light in this area.
    Thanks in Advance!

  2. Hi,
    Thank you for your information sharing.
    I have one doubt,could you please suggest me the correct frameworks to address that issue.

    My requirement is I would like to get and process files using spring and camel.

    Thanks,
    Madhu

Leave a Reply

Your email address will not be published. Required fields are marked *