Overview of the ServiceMix 1.x WSIF Example
This document describes the components that integrate with the Apache Web Service Invocation Framework (WSIF) to perform web service invocations using a number of different implementation protocols such as Axis, local Java, EJB, JMS, JCA and CCI.
The WSIF example illustrates the following:
- an example of declarative programming
- how to enable a service to be exposed over a JMS queue through WSIF
The following example shows how to bind a WSDL file for a web service, which is adorned with WSIF additional metadata to configure the service implementation.
<component id="checkAvailability" service="foo:checkAvailability" class="org.servicemix.components.wsif.WSIFBinding"> <property name="definitionResource" value="classpath:org/servicemix/components/wsif/service.wsdl"/> </component>
How it Works
The diagram below illustrates the logical flow of the program through the WSIF components:
The logical flow of the program is:
- A user opens a web browser and access a web form with a "zipcode" input field and a submit button. The submit button sends the form and the zipcode typed in by the user to a Servicemix HTTP binding component.
- The HTTP binding component creates an InOut exchange message through the client API. The message is sent through the NMR to the checkAvailability component
- The checkAvailability component sends the request to the JMS queue.
- The webservice is implemented with a message driven EJB (MDB), who's "onMessage" method is listening for messages on the queue
- The MDB, processes the request and sends back a response to the checkAvailability component through a temporary queue.
- The checkAvailability component receives the response from the queue.
- The checkAvailability component responds to the HTTP client.
- The HTTP client sends the result back to the web form. The value of the result property is displayed and let's the user know whether or not DSL is available at the zipcode.
Details
The following table provides more details about the function of each component and bean in the servicemix.xml
file:
Component or Bean ID |
Description |
---|---|
jbi |
jbi is the "id" of the JBI container and provides the basic infrastructure services for myComponent. During initialization, several singletons are instantiated: transactionManager, broker, jmsFactory, and jbi. Also, take note of the properties installationDirPath and deploymentDirPath defined in |
JMSClient |
This Java standalone program, through the ActiveMQConnectionFactory, connects to topic "demo.org.servicemix.source." It then creates a text message from the file |
myComponent |
This JMS service component subscribes to the "demo.org.servicemix.source" topic via its defaultDestinationName property specified in the |
jndi |
This bean loads up database and transaction manager resources, which will be used by the other components in the system. More importantly, the JNDI context must be configured so that PXE can be deployed. |
Pxe-install.jar |
This jarfile is located in the |
AsyncProcess-sa.jar |
This jarfile is located in the |
broker |
The broker bean uses the |
transactionManager |
This bean is configured to be the default transaction manager for the jbi container. This transaction manager provides transactional services between the resource adapter (in this case the ActiveMQ resource adapter provided by the jencks JCA container) and components in the jbi container. |
jmsFactory |
This bean listens on port 61616 and provides a pooled ActiveMQ connection. |
Related Documentation
For more information on the following topics please see: