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-cxf-bc

Overview

A JBI compliant HTTP/SOAP or JMS/SOAP binding component named servicemix-cxf-bc which use apache cxf internally.

The main features are:

  • JBI compliant Binding Component

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

  • SOAP 1.1 and 1.2 support

  • MIME attachments

  • Support for all MEPs as consumers or providers

  • SSL support

  • WS-Security support

  • WS-Policy support

  • WS-RM support

  • WS-Addressing support

Namespace and xbean.xml

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

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

  <!-- add cxfbc:consumer or cxfbc:provider definitions here -->

</beans>

Endpoint types

The servicemix-cxf-bc component defines two endpoints:

  • cxfbc:consumer :: a server-side cxf endpoint that will consume plain HTTP+SOAP requests and send them into the NMR to a given JBI endpoint

  • cxfbc:provider :: a client-side jbi endpoint which can receive requests from the NMR and send them to a given url where the service is provided

cxfbc:consumer

Endpoint properties

Property Name Type Description
busCfg java.lang.String the location of the CXF configuration file used to configure the CXF bus. This allows you to configure features like WS-RM and JMS runtime behavior.
delegateToJaas boolean Specifies if the endpoint delegate to JAASAuthenticationService to do the authentication.
endpoint java.lang.String <p> Get the endpoint implementation. </p>
features (java.lang.Object)\* Specifies the cxf features set for this endpoint
inFaultInterceptors (java.lang.Object)\* a list of beans configuring interceptors that process incoming faults
inInterceptors (java.lang.Object)\* a list of beans configuring interceptors that process incoming responses
interfaceName javax.xml.namespace.QName <p> Get the qualified name of the endpoint interface. </p>
jaasDomain java.lang.String jaasDomain of this cxfbc consumer endpoint
locationURI java.lang.String the HTTP address to which requests are sent. This value will overide any value specified in the WSDL.
mtomEnabled boolean Specifies if MTOM / attachment support is enabled. Default is <code>false</code>.
outFaultInterceptors (java.lang.Object)\* a list of beans configuring interceptors that process fault messages being returned to the consumer
outInterceptors (java.lang.Object)\* a list of beans configuring interceptors that process requests
properties java.util.Map Sets arbitrary properties that are added to the CXF context at the Endpoint level
providedBus org.apache.cxf.Bus a preconfigured CXF Bus object to use; overrides busCfg
schemaValidationEnabled boolean Specifies if the endpoint use schemavalidation for the incoming/outgoing message.
service javax.xml.namespace.QName <p> Get the service qualified name of the endpoint. </p>
synchronous boolean Specifies if the endpoint expects send messageExchange by sendSync .
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 number of second the endpoint will wait for a response. The default is unlimited.
useJBIWrapper boolean Specifies if the JBI wrapper is sent in the body of the message. Default is <code>true</code>.
useSOAPEnvelope boolean Specifies if the endpoint expects soap messages when useJBIWrapper is false,
wsdl org.springframework.core.io.Resource the location of the WSDL document defining the endpoint's interface
x509 boolean Specifies if the endpoint use X.509 Certificate to do the authentication.

cxfbc:provider

Endpoint properties

Property Name Type Description
busCfg java.lang.String the location of the CXF configuration file used to configure the CXF bus. This allows you to configure features like WS-RM and JMS runtime behavior.
endpoint java.lang.String <p> Get the endpoint implementation. </p>
features (java.lang.Object)\* Specifies the cxf features set for this endpoint
inFaultInterceptors (java.lang.Object)\* a list of beans configuring interceptors that process incoming faults
inInterceptors (java.lang.Object)\* a list of beans configuring interceptors that process incoming requests
interfaceName javax.xml.namespace.QName <p> Get the qualified name of the endpoint interface. </p>
locationURI java.net.URI the HTTP address of the exposed service. This value will overide any value specified in the WSDL.
mtomEnabled boolean Specifies if MTOM / attachment support is enabled. Default is <code>false</code>.
outFaultInterceptors (java.lang.Object)\* a list of beans configuring interceptors that process fault messages being returned to the consumer
outInterceptors (java.lang.Object)\* a list of beans configuring interceptors that process responses
properties java.util.Map Sets arbitrary properties that are added to the CXF context at the Endpoint level
providedBus org.apache.cxf.Bus a preconfigured CXF Bus object to use; overrides busCfg
schemaValidationEnabled boolean Specifies if the endpoint use schemavalidation for the incoming/outgoing message.
service javax.xml.namespace.QName <p> Get the service qualified name of the endpoint. </p>
synchronous boolean Specifies if the endpoints send message synchronously to external server using underlying
useJBIWrapper boolean Specifies if the JBI wrapper is sent in the body of the message. Default is <code>true</code>.
useSOAPEnvelope boolean Specifies if the endpoint expects soap messages when useJBIWrapper is false,
wsdl org.springframework.core.io.Resource the location of the WSDL document defining the endpoint's interface

Examples

Configuring the CXF JMS Transport

The ServiceMix CXF binding component also allows using the CXF JMS Transport to send and receive messages. You can use the <cxf:features/> element to add and configure the org.apache.cxf.transport.jms.JMSConfigFeature on the endpoint, as in the example below.

<cxfbc:provider wsdl="org/apache/servicemix/cxfbc/ws/security/hello_world.wsdl"
              service="greeter:HelloWorldService"
              endpoint="HelloWorldPortProxy"
              interfaceName="greeter:Greeter"
              busCfg="jms_conduit_config.xml">

  <!-- add interceptors here -->

  <cxfbc:features>
     <bean class="org.apache.cxf.transport.jms.JMSConfigFeature">
        <property name="jmsConfig">
            <bean class="org.apache.cxf.transport.jms.JMSConfiguration">
                <property name="concurrentConsumers">
                    <value>5</value>
                </property>
                <property name="connectionFactory">
                    <ref bean="myConnectionFactory" /> 
                </property>
                <property name="targetDestination">
                    <value>test.jmstransport.text.provider</value>
                </property>
                <property name="useJms11">
                    <value>false</value>
                </property>
            </bean>
         </property>
     </bean>
  </cxfbc:features>

</cxfbc:provider>

<amq:connectionFactory id="myConnectionFactory" brokerURL="vm://localhost"/>

The jms_conduit_config.xml file specified in the busCfg parameter, is optional and can be used to specify additional JMS transport parameters:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jms="http://cxf.apache.org/transports/jms"
       xsi:schemaLocation="
       http://cxf.apache.org/transports/jms http://cxf.apache.org/schemas/configuration/jms.xsd
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <jms:conduit name="{http://apache.org/hello_world_soap_http}HelloWorldPort.jms-conduit" abstract="true"> 
        <jms:clientConfig clientReceiveTimeout="200000"/>
    </jms:conduit>

</beans>

Configuring the CXF HTTP Transport

In order to configure the underlying HTTP transport used by a CXF BC endpoint, you can specify an additional busCfg file as in the example below.

<cxfbc:provider wsdl="org/apache/servicemix/cxfbc/ws/security/hello_world.wsdl"
              service="greeter:HelloWorldService"
              endpoint="HelloWorldPortProxy"
              interfaceName="greeter:Greeter"
              busCfg="http_conduit_config.xml">

  <!-- add interceptors and additional CXF features here -->

</cxfbc:provider>

The http_conduit_config.xml file can then specify the additional CXF configuration. Have a look at this page for an overview of all the options supported by CXF.

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
       xsi:schemaLocation="http://cxf.apache.org/transports/http/configuration
                           http://cxf.apache.org/schemas/configuration/http-conf.xsd
                           http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/beans/spring-beans.xsd">

  <http-conf:conduit name="{http://apache.org/hello_world_soap_http}HelloWorldPort.http-conduit">
    <http-conf:client Connection="Keep-Alive"
                      MaxRetransmits="1"
                      AllowChunking="false" />
  </http-conf:conduit>
</beans>