You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

We support both a client side HTTP (capable of invoking requests on remote HTTP servers) and a server side HTTP binding (for exposing JBI components over HTTP). Note that both these 2 components are pure HTTP bindings; they assume that a REST or SOAP service creates the inbound request first. So they just deal with the HTTP transport and do not perform any protocol encoding such as SOAP 1.1 or SOAP 1.2; they pass along the XML they are given.

Client side HTTP invocation

This JBI component uses Commons HttpClient to perform client side HTTP invocations. Here is a typical example of a JBI component which performs a HTTP invocation when it is invoked.

Error formatting macro: snippet: java.lang.NullPointerException

Server side HTTP binding

This JBI component will expose another JBI component over HTTP on some port and HTTP configuration. We use an embedded Jetty component for this, though we also have a BindingServlet which can be configured from inside any web.xml in a Servlet WAR.

Here's an example of configuring the default HTTP connector.

Error formatting macro: snippet: java.lang.NullPointerException

Using HTTP binding in a WAR

You may wish to configure ServiceMix's HTTP binding inside a WAR. To do this you need to register one or more instances of the SpringBindingServlet in your web.xml then map the servlet to the URI you wish.

Here's an example

Error formatting macro: snippet: java.lang.NullPointerException

Notice that the web.xml then refers to the endpoint name in the ServiceMix configuration file. e.g. this component

Error formatting macro: snippet: java.lang.NullPointerException
  • No labels