blob: 1ada5712c2bc7c978b4b3aa97992d77a2c5013b2 [file] [log] [blame]
h2. servicemix-cxf-bc
h3. 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
h4. 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}}.
{pygmentize:lang=xml}
<beans xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0">
<!-- add cxfbc:consumer or cxfbc:provider definitions here -->
</beans>
{pygmentize}
h4. 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
h3. {{cxfbc:consumer}}
h4. Endpoint properties
{include:jbi/components/_servicemix-cxf-bc-consumer.conf}
h3. {{cxfbc:provider}}
h4. Endpoint properties
{include:jbi/components/_servicemix-cxf-bc-provider.conf}
h3. Examples
h4. 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.
{pygmentize:lang=xml}
<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"/>
{pygmentize}
The {{jms_conduit_config.xml}} file specified in the {{busCfg}} parameter, is optional and can be used to specify additional JMS transport parameters:
{pygmentize:lang=xml}
<?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>
{pygmentize}
h4. 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.
{pygmentize:lang=xml}
<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>
{pygmentize}
The {{http_conduit_config.xml}} file can then specify the additional CXF configuration. Have a look at [this page|http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html] for an overview of all the options supported by CXF.
{pygmentize:lang=xml}
<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>
{pygmentize}