Versions Compared

Key

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

Overview of the ServiceMix 2.x

...

HTTP Binding Example

The following procedure describes how to run the Http HTTP Binding example and provides details regarding what it does. For information on the business use case, please refer to: Use Case for Http HTTP Binding.

The Http HTTP Binding example illustrates:

  • use of declarative programming
  • how to perform Http binding in ServiceMix

The source code for the Http HTTP Binding example is located in the ServiceMix installation directory under the examples\http-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 use the HTTP bindings to handle a simple http post. One component acts as the http server that listens on http://localhost:8912 while another invokes a remote service implemented as a URLEndpoint. A simple HTTP client is provided so that a simple post can be set to the server.

Running the

...

HTTP Binding Example

  1. From a command shell, go to the Http HTTP Binding example directory:
    Code Block
    cd [servicemix_install_dir]\examples\http-binding
    
    where servicemix_install_dir is the directory in which ServiceMix was installed.
  2. Then type:
    Code Block
    [servicemix_install_dir]\bin\servicemix servicemix.xml
    
  3. To start sending and receiving of messages from the Http server, send an initial message. To do this, compile and run a simple Http client. The client is built and run from source code using Ant. Execute Ant from the Http 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.

Stopping the

...

HTTP Binding Example

To terminate the Http 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.

...

The diagram below illustrates the flow of messages through the Http HTTP Binding components:

Panel
borderColor#ccc
titleHttp HTTP Binding Example Message Flow Diagram
borderStylesolid

...