WAS v8.5 > Develop applications > Develop SCA composites > Specify bindings in an SCA environment > Configure the SCA JMS binding > Configure SCA JMS binding wire formats

Configure JMS binding request and response wire formats

We can configure the messaging data formats between an SCA application and a JMS producer or consumer, by configuring your SCA application to take advantage of a supported message type and data format. In general, each wire format can map to the service or reference side, and even into serialization and deserialization. As a result, we can configure each service or reference request and response to use different wire formats.


Configure the JMS binding for the SCA application. Then, configure the JMS binding wire format.

WAS v8.5 supports both the OASIS and the OSOA SCA JMS binding specification. Unless otherwise specified, the information in this topic pertains to applications for both the OSOA and OASIS specification. In most cases, the response wire format can be the same as the request wire format for a messaging application. However, in certain scenarios this might not be reasonable, such as when the inputs and outputs of an operation cannot use the same wire format. In this situation, we can override the request wire format by explicitly configuring the response wire format with a wireformat element as a child on the binding.jms response element.

When choosing a request and response wire format, consider any restrictions imposed by the application itself and also the limitations of any particular wire format. For example, consider the following interface method:

MyJavaObject is not an XML-serializable object and MyJAXBObject is not Java-serializable so we cannot use only one wire format. However, we can use wireFormat.jmsTextXML for the request wire format and wireFormat.jmsObject for the response.

  1. Open an editor on a composite definition file and configure a reference-side wire format.

    A reference-side wire format resembles the following:

    OSOA

      <component name="JAXBJMSFrontendReqRespWFComponent"> <implementation.java class="com.ibm.test.soa.sca.frontend.HelloWorldJAXBFrontendImpl"/> <reference name="hwJAXBService"> <interface.java interface="com.ibm.test.soa.sca.HelloWorldJAXBService"/> <binding.jms> <destination name="jms/SCA_JMS_Request1"/> <connectionFactory name="jms/SCA_JMS_CF"/> <response> <destination name="jms/SCA_JMS_Response1"/> <connectionFactory name="jms/SCA_JMS_CF"/> <ts:wireFormat.jmsObject/> </response> </binding.jms> </reference> </component>

    OASIS

      <component name="JAXBJMSFrontendReqRespWFComponent"> <implementation.java class="com.ibm.test.soa.sca.frontend.HelloWorldJAXBFrontendImpl"/> <reference name="hwJAXBService"> <interface.java interface="com.ibm.test.soa.sca.HelloWorldJAXBService"/> <binding.jms> <destination jndiName="jms/SCA_JMS_Request1"/> <connectionFactory jndiName="jms/SCA_JMS_CF"/> <response> <ts:wireFormat.jmsObject/> <destination jndiName="jms/SCA_JMS_Response1"/> <connectionFactory jndiName="jms/SCA_JMS_CF"/> </response> </binding.jms> </reference> </component>

    In the example component configuration, the binding level wire format is the default because no wire format is specified. However, the response wire format is overridden by the jmsObject wire format.

  2. Open an editor on a composite definition file and configure a service-side wire format.

    A service-side wire format resembles the following:

    OSOA

      <component name="JAXBJMSBackendReqRespWFComponent"> <implementation.java class="com.ibm.test.soa.sca.backend.HelloWorldJAXBBackendImpl"/> <service name="HelloWorldJAXBService"> <interface.java interface="com.ibm.test.soa.sca.HelloWorldJAXBService"/> <binding.jms> <destination name="jms/SCA_JMS_Response1"/> <activationSpec name="jms/SCA_JMS_AS1"/> <response> <destination name="jms/SCA_JMS_Response1"/> <connectionFactory name="jms/SCA_JMS_CF"/> <ts:wireFormat.jmsObject/> </response> </binding.jms> </service> </component>

    OASIS

      <component name="JAXBJMSBackendReqRespWFComponent"> <implementation.java class="com.ibm.test.soa.sca.backend.HelloWorldJAXBBackendImpl"/> <service name="HelloWorldJAXBService"> <interface.java interface="com.ibm.test.soa.sca.HelloWorldJAXBService"/> <binding.jms> <destination jndiName="jms/SCA_JMS_Response1"/> <activationSpec jndiName="jms/SCA_JMS_AS1"/> <response> <ts:wireFormat.jmsObject/> <destination jndiName="jms/SCA_JMS_Response1"/> <connectionFactory jndiName="jms/SCA_JMS_CF"/> </response> </binding.jms> </service> </component>

    The response wire format is always the same as the request wire format unless the response level wire format is explicitly configured.


Results

You have configured the request and response wire format for a messaging application.


Examples

More example component configurations that show request and response wire formats follow.

Component configuration for a multiple-parameter reference

OSOA

OASIS

Component configuration for a multiple-parameter service that uses jmsBytesXML wire format

OSOA

OASIS

Component configuration for a reference that uses jmsText wire format for the response and a jmsCustom format for the binding

OSOA

OASIS

Component configuration for a service that uses jmsText wire format for the response and a jmsCustom format for the binding

OSOA

OASIS

Deploy and test the wire format configuration in your SCA application.


Related


Configure SCA JMS binding wire formats
Configure the SCA JMS binding


Reference:

Service Component Architecture specifications and APIs


+

Search Tips   |   Advanced Search