Red Hat Training

A Red Hat training course is available for JBoss Enterprise SOA Platform

Chapter 21. Integrating External Web Services with the JBoss Enterprise SOA Platform

21.1. Web Service

A web service is a way of making two applications communicate over the web. A web service consists of a set of tools to achieve this aim. There are two types of web service: REST-compliant ones, (the purpose of which is to manipulate XML representations of web resources) and arbitrary Web services (through which the service can expose any operation).

21.2. Web Service End-Point

A web service end-point is software that implements a web service. They are used to implement message-based communication between web services in a service-oriented architectural environment.
The external applications to which these registry entries point can include .NET programs, other external Java-based application servers and LAMP software bundles.

21.3. Web Services Description Language (WSDL)

The Web Services Description Language (WSDL) is an XML-based language that is used to define Web service interfaces. An application that consumes a Web service parses the service’s WSDL document to discover the:
  • location of the service
  • the operations that the service supports
  • the protocol bindings the service supports (SOAP, HTTP, etc)
  • access procedure
For each operation, the WSDL describes the interface format to which the client must adhere.

21.4. REST

REST (Representational State Transfer) is a type of software architecture, consisting of clients and servers. It was designed specifically for distributed networks, including the internet. Central to this is the idea of multiple resources (data sources), each of which is identified by a unique, global address. In order to manipulate these resources,the clients and servers communicate via a standardized interface and exchange data.

21.5. SOAPProcessor

The SOAPProcessor is an action that allows you to invoke a JBossWS-hosted web service end-point through any JBossESB-hosted listener. Via this action, the enterprise service bus can expose web service end-points for services that do not already expose them. You can then invoke services over any transport channel supported by the enterprise service bus, such as HTTP, FTP or JMS.
The SOAPProcessor supports both the JBossWS-Native and JBossWS-CXF stacks.

21.6. SOAPProxy

The SOAPProxy is an action that "consumes" external web service end-points. It also allows you to re-publish a web service end-point via the Enterprise Service Bus. Sitting between the external services and the ESB, the purpose of this intermediary is to provide an abstraction layer it provides the following functionality:
  • it facilitates loose coupling between the client and service (since they are both completely unaware of each other.)
  • it means the client no longer has a direct connection to the remote service's hostname/IP address.
  • the client will see modified WSDL that changes the inbound/outbound parameters. At a minimum, the WSDL must be tweaked so that the client is pointed to the ESB's exposed end-point instead of the original, now proxied endpoint.
  • it allows you to introduce a transformation of the SOAP envelope/body via the action pipeline both for the inbound request and outbound response.
  • it makes service versioning possible since clients can connect to two or more proxy end-points on the enterprise service bus, each with its own WSDL and/or transformations and routing requirements, and the ESB will send the appropriate message to the appropriate endpoint and provide an ultimate response.
  • it allows for complex context-based routing via ContentBasedRouter.

21.7. Advantages of Integrating Web Services with the Enterprise Service Bus

The JBoss Enterprise SOA Platform's enterprise service bus sits between the producer of the resource and the client application that ultimately consumes it. The ESB's purpose is to provide an abstraction layer, thereby giving these advantages:
  • the client and the service can be coupled loosely since they will be completely unaware of each other's existence.
  • the client is no longer connected directly to the remote service's hostname or IP address.
  • the client can see a modified WSDL, changing the inbound/outbound parameters. (Note that, at a minimum, one must modify the WSDL so that the client is pointing to the end-point exposed by the Enterprise Service Bus, rather than the original end-point.)
  • you can introduce a SOAP envelope/body transformation via the action pipeline that will apply to both the inbound request and the outbound response.
  • you can implement service versioning since clients can connect to two or more proxy end-points, each with its own WSDL and/or transformations and routing requirements. The Enterprise Service Bus will send the appropriate message to the correct end-point and then return a response.
  • the ContentBasedRouter class can be used to introduce advanced routing functionality.

21.8. Configure Web Service Integration

Procedure 21.1. Task

  • QE/SME to provide information.

21.9. Republish a Web Service Using the SOAPProxy Action

Procedure 21.2. Task

  • QE/SME to provide information.

21.10. Content-Based Router

Content-based routers send messages that do not have destination addresses to their correct end-points. Content-based routing works by applying a set of rules (which can be defined within XPath or Drools notation) to the body of the message. These rules ascertain which parties are interested in the message. This means the sending application does not have to supply a destination address.
A typical use case is to serve priority messages in a high priority queue. The advantage here is that the routing rules can be changed on-the-fly while the service runs if it is configured in that way. (However, this has significant performance drawbacks.)
Other situations in which a content-based router might be useful include when the original destination no longer exists, the service has moved or the application simply wants to have more control over where messages go based on its content of factors such as the time of day.

21.11. Static-Based Router

A static-based router helps to coordinate information across your network. It transfers information between servers and tells them where to send their messages. You can program it to take certain routes if you feel the default is inefficient. You can only use it to route to other services.

21.12. Routing Key

A routing key is used to match messages and the items to which they are bound. In the context of the JBoss Enterprise SOA Platform, the routing key can be applied to a message which will then be sent to a queue which has been given the same routing key.