In our example we will use XML marshalling using JAXB 2. Now we will have to configure the XML marshaller and endpoint adapters in the Spring configuration file as shown in Listing 16-7 below. Configuring XML marshaller in Spring configuration file Following the pattern of Spring in other technologies, it provides Webservice Template similar to Jdbc Template and JMSTemplate to aid implementing the client for web service consumption and use.
This article is part of our Academy Course titled Spring Integration for EAI.Using XML marshalling makes it easy to work with object oriented methodologies.spring Ws supports different Object-XML frameworks namely JAXB (1 and 2), Castor, Ji BX, XStream and XMLBeans.The infrastructure details required to send the message are handled by Spring Integration.There are some more attributes that are available for customizing the invocation with the gateway.In order to accomplish it, this example will focus on the integration with external web services.
First, I will explain what are the necessary adapters that will allow us to invoke a web service from Spring Integration.In this section we are going to focus on this type.In order to use a web service gateway, you will need to specify a new namespace: As you see, you just need to define the flow (request and reply channels) and where to call.As explained in the previous tutorial, you can find two types of gateways: inbound and outbound.In this tutorial we will be using a special type of gateway: an outbound web service gateway.Below, there is a brief description of the main attributes: This section is just a quick reference to the inbound service gateway in order to know how it generally works, since we will not use it in this tutorial.