JBI Support deprecated in Apache ServiceMix 4

JBI 1.0 support is available in Apache ServiceMix 4 to allow existing users to migrate more easily to this latest version - if you're a new user, you should consider JBI deprecated and not use it for your project. Take a look at our technology selection guidelines for more information.

servicemix-http

Overview

ServiceMix ships with a JBI compliant HTTP/SOAP binding component named servicemix-http.

Here are the main features:

  • JBI compliant Binding Component

  • Usable in a lightweight mode in servicemix.xml configuration files

  • Integrated HTTP server based on Jetty 6

  • HTTP Client using Jakarta Commons HTTP Client

  • Highly performant and scalable using Jetty 6 continuations

  • SOAP 1.1 and 1.2 support

  • MIME attachments

  • WS-Addressing support

  • WSDL based and XBean based deployments

  • Support for all MEPs as consumers or providers

  • SSL support

  • WS-Security support

Namespace and xbean.xml

The namespace URI for the servicemix-bean JBI component is http://servicemix.apache.org/http/1.0. This is an example of an xbean.xml file with a namespace definition with prefix bean.

<beans xmlns:http="http://servicemix.apache.org/http/1.0">

  <!-- add http:consumer, http:soap-consumer
           http:provider and http soap:provider definitions here -->

</beans>

Endpoint types

The servicemix-http component defines four endpoint type:

  • http:consumer :: This endpoint allows you to expose a service in the ESB to the outside world over HTTP. Whenever it receives an HTTP request, it will interact with the configured services on the ESB to provide the HTTP response.

  • http:soap-consumer :: Similar to http:consumer, but specifically geared towards handing SOAP requests and responses

  • http:provider :: This endpoint allows you to access remote services from within the ESB. It will perform an external HTTP request whenever it receives a JBI MessageExchange

  • http:soap-provider :: Similar to http:provider, but specifically geared towards performing SOAP requests

It also provides one additional legacy endpoints, which are still available to ease migration from ServiceMix 3:

  • http:endpoint :: (Deprecated) Legacy endpoint, capable to acting as a consumer or provider based on the configuration

http:endpoint

Endpoint properties

Property Name Type Description
authMethod java.lang.String a string naming the scheme used for authenticating users
basicAuthentication org.apache.servicemix.http.BasicAuthCredentials authentication data for using basic HTTP authentication.
binding javax.wsdl.extensions.ExtensibilityElement
defaultMep java.net.URI
defaultOperation javax.xml.namespace.QName
description org.w3c.dom.Document
dynamic boolean
endpoint java.lang.String <p> Get the endpoint implementation. </p>
interfaceName javax.xml.namespace.QName <p> Get the qualified name of the endpoint interface. </p>
lateResponseStrategy java.lang.String Set the strategy to be used for handling a late response from the ESB (i.e. a response that arrives after the HTTP request has timed out). Defaults to <code>error</code> <p/> <ul> <li><code>error</code> will terminate the exchange with an ERROR status and log an exception for the late response</li> <li><code>warning</code> will end the exchange with a DONE status and log a warning for the late response instead</li> </ul>
locationURI java.lang.String the URI to which a provider endpoint sends requests
policies (java.lang.Object)\*
proxy org.apache.servicemix.http.ProxyParameters configuration used to establish a proxy for sending HTTP requests. This configuration overrides that which is set at the component level.
responseContentTypeCheck boolean Specifies if the http provider checks the response content type for the
role java.lang.String HTTP endpoints can be either consumers or providers. Specifying
roleAsString java.lang.String
service javax.xml.namespace.QName <p> Get the service qualified name of the endpoint. </p>
soap boolean
soapAction java.lang.String
soapVersion java.lang.String
ssl org.apache.servicemix.http.SslParameters a bean containing the SSL configuration properties
supportAllHttpMethods boolean configuration indicator in order to support all HTTP methods by a HTTP consumer endpoint, otherwise only GET,POST methods are supported
synchronous boolean
targetEndpoint java.lang.String
targetInterfaceName javax.xml.namespace.QName
targetService javax.xml.namespace.QName
timeout int the number of milliseconds before the endpoint times out. The default value is 0 which means that the endpoint will never timeout.
wantContentTypeHeaderFromExchangeIntoHttpRequest boolean Specifies if the HTTP provider will copy the HTTP request headers into the JBI
wsdlResource org.springframework.core.io.Resource

http:consumer

Endpoint properties

Property Name Type Description
authMethod java.lang.String a string naming the scheme used for authenticating users
component org.apache.servicemix.common.DefaultComponent
defaultMep java.net.URI a URI representing the endpoint's default MEP. The default is <code>JbiConstants.IN_OUT</code>.
endpoint java.lang.String <p> Get the endpoint implementation. </p>
interfaceName javax.xml.namespace.QName <p> Get the qualified name of the endpoint interface. </p>
lateResponseStrategy java.lang.String Set the strategy to be used for handling a late response from the ESB (i.e. a response that arrives after the HTTP request has timed out). Defaults to <code>error</code> <p/> <ul> <li><code>error</code> will terminate the exchange with an ERROR status and log an exception for the late response</li> <li><code>warning</code> will end the exchange with a DONE status and log a warning for the late response instead</li> </ul>
locationURI java.lang.String the URI at which the endpoint listens for requests
marshaler org.apache.servicemix.http.endpoints.HttpConsumerMarshaler the bean used to marshal HTTP messages. The default is a <code>DefaultHttpConsumerMarshaler</code>.
rewriteSoapAddress boolean Toggles the rewriting of the soap address based on the request info. <p> When active, the soap address in the wsdl will be updated according to the protocol, host and port of the request. This is useful when listening on 0.0.0.0 or when behind a NAT (or reverse-proxy in some cases).<br /> This function only works on the main wsdl, not in imported wsdl-parts. This means the service with its port must be declared in the main wsdl. </p><p> By default it is activated. </p>
service javax.xml.namespace.QName <p> Get the service qualified name of the endpoint. </p>
serviceUnit org.apache.servicemix.common.ServiceUnit
ssl org.apache.servicemix.http.SslParameters a bean containing the SSL configuration properties
targetEndpoint java.lang.String the name of the endpoint to which requests are sent
targetInterface javax.xml.namespace.QName the QName of the interface to which requests are sent
targetOperation javax.xml.namespace.QName the QName of the operation to which requests are sent
targetService javax.xml.namespace.QName the QName of the service to which requests are sent
targetUri java.lang.String <p> Gets the target URI of the consumer endpoint. </p>
timeout long the timeout is specified in milliseconds. The default value is 0 which means that the endpoint will never timeout.

http:provider

Endpoint properties

Property Name Type Description
clientConnectTimeout int the number of milliseconds the endpoint will block while attempting to read a request. The default value is 60000. Setting this to 0 specifies that the endpoint will never timeout.
component org.apache.servicemix.common.DefaultComponent
credentials java.lang.String The authentication credentials
endpoint java.lang.String <p> Get the endpoint implementation. </p>
expectGzippedResponse boolean If true, the accept-encoding http header will be set to gzip and the response will be un-gzipped.
gzipRequest boolean If true, the request content will be gzipped and sent over the wire. The content-encoding http header will also be set to gzip.
interfaceName javax.xml.namespace.QName <p> Get the qualified name of the endpoint interface. </p>
listener org.apache.servicemix.http.endpoints.HttpProviderListener the bean used monitor Jetty Client instance and to handle some Jetty Client events
locationURI java.lang.String the URI to which the endpoint sends requests
marshaler org.apache.servicemix.http.endpoints.HttpProviderMarshaler the bean used to marshal HTTP messages. The default is a
maxConnectionsPerAddress int the number of the maximum connections per address that JettyClient creates for each destination. The default is 32.
principal java.lang.String The authentication principal
providerExpirationTime int the number of milliseconds to wait for a response before expiring.
proxyHost java.lang.String the host name of the HTTP proxy
proxyPassword java.lang.String the password for the HTTP proxy authentication
proxyPort int the host port of the HTTP proxy (defaults to 80)
proxyUsername java.lang.String the user name for the HTTP proxy authentication
service javax.xml.namespace.QName <p> Get the service qualified name of the endpoint. </p>
serviceUnit org.apache.servicemix.common.ServiceUnit
ssl org.apache.servicemix.http.SslParameters the SSL parameters

http:soap-consumer

Endpoint properties

Property Name Type Description
authMethod java.lang.String a string naming the scheme used for authenticating users
component org.apache.servicemix.common.DefaultComponent
defaultMep java.net.URI a URI representing the endpoint's default MEP. The default is <code>JbiConstants.IN_OUT</code>.
endpoint java.lang.String <p> Get the endpoint implementation. </p>
interfaceName javax.xml.namespace.QName <p> Get the qualified name of the endpoint interface. </p>
lateResponseStrategy java.lang.String Set the strategy to be used for handling a late response from the ESB (i.e. a response that arrives after the HTTP request has timed out). Defaults to <code>error</code> <p/> <ul> <li><code>error</code> will terminate the exchange with an ERROR status and log an exception for the late response</li> <li><code>warning</code> will end the exchange with a DONE status and log a warning for the late response instead</li> </ul>
locationURI java.lang.String the URI at which the endpoint listens for requests
marshaler org.apache.servicemix.http.endpoints.HttpConsumerMarshaler the bean used to marshal HTTP messages. The default is a <code>DefaultHttpConsumerMarshaler</code>.
policies (org.apache.servicemix.soap.api.Policy)\* a list of interceptors that will process messages
rewriteSoapAddress boolean Toggles the rewriting of the soap address based on the request info. <p> When active, the soap address in the wsdl will be updated according to the protocol, host and port of the request. This is useful when listening on 0.0.0.0 or when behind a NAT (or reverse-proxy in some cases).<br /> This function only works on the main wsdl, not in imported wsdl-parts. This means the service with its port must be declared in the main wsdl. </p><p> By default it is activated. </p>
service javax.xml.namespace.QName <p> Get the service qualified name of the endpoint. </p>
serviceUnit org.apache.servicemix.common.ServiceUnit
soapVersion java.lang.String Specifies the SOAP version to use when generating a wsdl binding for
ssl org.apache.servicemix.http.SslParameters a bean containing the SSL configuration properties
targetEndpoint java.lang.String the name of the endpoint to which requests are sent
targetInterface javax.xml.namespace.QName the QName of the interface to which requests are sent
targetOperation javax.xml.namespace.QName the QName of the operation to which requests are sent
targetService javax.xml.namespace.QName the QName of the service to which requests are sent
targetUri java.lang.String <p> Gets the target URI of the consumer endpoint. </p>
timeout long the timeout is specified in milliseconds. The default value is 0 which means that the endpoint will never timeout.
useJbiWrapper boolean Specifies if the JBI wrapper is sent in the body of the message. Default is
validateWsdl boolean Specifies if the WSDL is checked for WSI-BP compliance. Default is <code>true</code>.
wsdl org.springframework.core.io.Resource the URL of the WSDL document defining the endpoint's messages

http:soap-provider

Endpoint properties

Property Name Type Description
clientConnectTimeout int the number of milliseconds the endpoint will block while attempting to read a request. The default value is 60000. Setting this to 0 specifies that the endpoint will never timeout.
component org.apache.servicemix.common.DefaultComponent
credentials java.lang.String The authentication credentials
endpoint java.lang.String <p> Get the endpoint implementation. </p>
expectGzippedResponse boolean If true, the accept-encoding http header will be set to gzip and the response will be un-gzipped.
gzipRequest boolean If true, the request content will be gzipped and sent over the wire. The content-encoding http header will also be set to gzip.
interfaceName javax.xml.namespace.QName <p> Get the qualified name of the endpoint interface. </p>
listener org.apache.servicemix.http.endpoints.HttpProviderListener the bean used monitor Jetty Client instance and to handle some Jetty Client events
locationURI java.lang.String the URI to which the endpoint sends requests
marshaler org.apache.servicemix.http.endpoints.HttpProviderMarshaler the bean used to marshal HTTP messages. The default is a
maxConnectionsPerAddress int the number of the maximum connections per address that JettyClient creates for each destination. The default is 32.
policies (org.apache.servicemix.soap.api.Policy)\* a list of interceptors that will process messages
principal java.lang.String The authentication principal
providerExpirationTime int the number of milliseconds to wait for a response before expiring.
proxyHost java.lang.String the host name of the HTTP proxy
proxyPassword java.lang.String the password for the HTTP proxy authentication
proxyPort int the host port of the HTTP proxy (defaults to 80)
proxyUsername java.lang.String the user name for the HTTP proxy authentication
service javax.xml.namespace.QName <p> Get the service qualified name of the endpoint. </p>
serviceUnit org.apache.servicemix.common.ServiceUnit
ssl org.apache.servicemix.http.SslParameters the SSL parameters
useJbiWrapper boolean Specifies if the JBI wrapper is sent in the body of the message. Default is
validateWsdl boolean Specifies if the WSDL is checked for WSI-BP compliance. Default is <code>true</code>
wsdl org.springframework.core.io.Resource the URL of the WSDL document defining the endpoint's messages