Skip to main content

Define service endpoint or proxy in spring or blueprint

The JAXWS endpoint or proxy can be defined like in the SOAP/HTTP case. Just use a jms: uri like described above.

In CXF 3 it is possible to omit the jndi settings. Just specify an endpoint like this:

Endpoint in spring

<bean id="ConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616"/>
</bean>
<jaxws:endpoint id="CustomerService"
    address="jms:queue:test.cxf.jmstransport.queue?timeToLive=1000"
    implementor="com.example.customerservice.impl.CustomerServiceImpl"/>
</jaxws:endpoint>

or a Client like this:

Proxy in spring

<bean id="ConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616"/>
</bean>
<jaxws:client id="CustomerService"
    address="jms:queue:test.cxf.jmstransport.queue?timeToLive=1000"
    serviceClass="com.example.customerservice.CustomerService">
</jaxws:client>

The connection factory will be looked up as a bean in the context. By default the name "ConnectionFactory" is assumed but it can be configured using the jndiConnectionFactoryName uri parameter.

Alternatively the connection factory can be set using the ConnectionFactoryFeature.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!