Specifying the message type
You can specify the message type supported by the consumer endpoint using a jms:runtimePolicy element that has a single attribute:
-
messageType - Specifies how the message data will be packaged as a JMS message. text specifies that the data will be packaged as a TextMessage . binary specifies that the data will be packaged as an ObjectMessage .
The following example shows a configuration entry for configuring a JMS consumer endpoint.
Configuration for a JMS Consumer Endpoint
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ct="http://cxf.apache.org/configuration/types"
xmlns:jms="http://cxf.apache.org/transports/jms"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/transports/jms
http://cxf.apache.org/schemas/configuration/jms.xsd">
...
<jms:conduit
name="{http://cxf.apache.org/jms_endpt}HelloJMSPort.jms-conduit">
<jms:address ... >
...
</jms:address>
<jms:runtimePolicy messageType="binary"/>
...
</jms:conduit>
...
</beans>
The id on the jms:conduit is in the form of { WSDLNamespace}WSDLPortName.jms-conduit . This provides CXF with the information so that it can associate the configuration with your service's endpoint.