Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The source code for the RSS Binding example is located in the ServiceMix installation directory under the examples\rss-binding directory in the servicemix.xml file. It is recommended that you refer to the source code while reading this document.

This example shows how to monitor RSS feed for changes. The main component polls the RSS periodically and when an update is found the RSS item is send to a trace component for logging.

Running the

...

RSS Binding Example

  1. From a command shell, go to the HTTP RSS Binding example directory:
    Code Block
    cd [servicemix_install_dir]\examples\httprss-binding
    
    where servicemix_install_dir is the directory in which ServiceMix was installed originally.
  2. Then type:
    Code Block
    [servicemix_install_dir]\bin\servicemix servicemix.xml
    
    To start sending and receiving messages from the HTTP server, send an initial message. To do this, compile and then run a simple HTTP client. The HTTP client used in this example, is built and run from source code using Ant. Execute Ant from the HTTP Binding directory: servicemix_install_dir\examples\http-binding. To run the HTTP client type:
    Code Block
    
    ant
    
    Ant will compile and run the simple HTTP client, HttpClient, which performs a simple post on the HTTP Server into the ServiceMix container, before returning the results to the console.
Tip
titleHandy Hint

Add $SERVICEMIX_HOME/bin directory to $PATH variable to simplify execution of the examples.


Stopping the

...

RSS Binding Example

To terminate the HTTP Binding example, type "CTRL-C" in the command shell in which it is running and answer "y" to the "Terminate batch job (y/n)?" question.

...

Component or Bean ID

Description

jbi

jbi is the "id" of the JBI container and provides the basic infrastructure services for the following components: httpReceiver and stockQuote. During initialization, several singletons are instantiated: URLEndpoint and JBI. After initialization, the components in the JBI container are activated.

httpReceiver

This component is an HTTP server that listens at

http://localhost/8912Image Removed

. It forwards the message it receives from this URL to stockQuote as specified in its destinationService property in the servicemix.xml file.

stockQuote

This is a SaajBinding component that invokes an endpoint service called soapEndpoint. It is implemented by the SaajBinding class which converts an inbound JBI message into a SAAJ (Soap With Attachments for Java) request-response and sends the response back to httpReceiver. This provides a message centric way of invoking SOAP services inside providers such as Apache Axis.

RssPollingComponent

StreamWriterComponent

soapEndpoint

A URLEndpoint object contains a URL, which is used to make connections to the remote party. A stand-alone client can pass a URLEndpoint object to the SOAPConnection method call to send a message.

Useful Code Hints

This section describes the start-up sequence and how the ServiceMix container interacts with the HTTP Binding application. The Java class files are located in the servicemix-2.0.2.jar file in the ServiceMix installation directory. To review the Java source code, unjar and decompile the .class files or download the source code.

...