You 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, you can configure each service or reference request and response to use different wire formats.
Configure the JMS binding for your SCA application. Then, configure the JMS binding wire format.
The product 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, you 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:
public MyJavaObject method(MyJAXBObject mjo)
MyJavaObject is not an XML-serializable object and MyJAXBObject is not Java-serializable so you cannot use only one wire format. However, you can use wireFormat.jmsTextXML for the request wire format and wireFormat.jmsObject for the response.
You have configured the request and response wire format for a messaging application.
More example component configurations that show request and response wire formats follow.
Component configuration for a multiple-parameter reference
OSOA
<component name="MultipleParameterFrontendReqRespWFComponent">
<implementation.java class="com.ibm.test.soa.sca.frontend.MultipleParameterFrontendImpl"/>
<reference name="mpService">
<interface.java interface="com.ibm.test.soa.sca.MultipleParameterService"/>
<binding.jms>
<destination name="jms/SCA_JMS_Request2"/>
<connectionFactory name="jms/SCA_JMS_CF"/>
<response>
<destination name="jms/SCA_JMS_Response2"/>
<connectionFactory name="jms/SCA_JMS_CF"/>
<ts:wireFormat.jmsObject/>
</response>
<ts:wireFormat.jmsObject/>
</binding.jms>
</reference>
</component>
<component name="MultipleParameterFrontendReqRespWFComponent">
<implementation.java class="com.ibm.test.soa.sca.frontend.MultipleParameterFrontendImpl"/>
<reference name="mpService">
<interface.java interface="com.ibm.test.soa.sca.MultipleParameterService"/>
<binding.jms>
<ts:wireFormat.jmsObject/>
<destination jndiName="jms/SCA_JMS_Request2"/>
<connectionFactory jndiName="jms/SCA_JMS_CF"/>
<response>
<ts:wireFormat.jmsObject/>
<destination jndiName="jms/SCA_JMS_Response2"/>
<connectionFactory jndiName="jms/SCA_JMS_CF"/>
</response>
</binding.jms>
</reference>
</component>
Component configuration for a multiple-parameter service that uses jmsBytesXML wire format
OSOA
<component name="MultiParameterJMSBackendReqRespWFComponent">
<implementation.java class="com.ibm.test.soa.sca.backend.MultipleParameterBackendImpl"/>
<service name="MultipleParameterService">
<interface.java interface="com.ibm.test.soa.sca.MultipleParameterService"/>
<binding.jms>
<destination name="jms/SCA_JMS_Request2"/>
<activationSpec name="jms/SCA_JMS_AS2"/>
<response>
<destination name="jms/SCA_JMS_Response2"/>
<connectionFactory name="jms/SCA_JMS_CF" create="never"/>
<ts:wireFormat.jmsBytesXML/>
</response>
</binding.jms>
</reference>
</component>
<component name="MultiParameterJMSBackendReqRespWFComponent">
<implementation.java class="com.ibm.test.soa.sca.backend.MultipleParameterBackendImpl"/>
<service name="MultipleParameterService">
<interface.java interface="com.ibm.test.soa.sca.MultipleParameterService"/>
<binding.jms>
<destination jndiName="jms/SCA_JMS_Request2"/>
<activationSpec jndiName="jms/SCA_JMS_AS2"/>
<response>
<ts:wireFormat.jmsBytesXML/>
<destination jndiName="jms/SCA_JMS_Response2"/>
<connectionFactory jndiName="jms/SCA_JMS_CF" create="never"/>
</response>
</binding.jms>
</reference>
</component>
Component configuration for a reference that uses jmsText wire format for the response and a jmsCustom format for the binding
OSOA
<component name="FrontEndWireFormatHandlerReqRespWFComponent">
<implementation.java class="com.ibm.test.soa.sca.frontend.CustomReqRespFrontEndComponent"/>
<reference name="frontEnd">
<binding.jms>
<destination name="jms/SCA_JMS_Request3"/>
<connectionFactory name="jms/SCA_JMS_CF"/>
<response>
<destination name="jms/SCA_JMS_Response3"/>
<connectionFactory name="jms/SCA_JMS_CF"/>
<ts:wireFormat.jmsText/>
</response>
<ts:wireFormat.jmsCustom class="com.ibm.test.soa.sca.frontend.custom.FrontEndReqRespWireFormatHandler"/>
</binding.jms>
</reference>
</component>
<component name="FrontEndWireFormatHandlerReqRespWFComponent">
<implementation.java class="com.ibm.test.soa.sca.frontend.CustomReqRespFrontEndComponent"/>
<reference name="frontEnd">
<binding.jms>
<ts:wireFormat.jmsCustom class="com.ibm.test.soa.sca.frontend.custom.FrontEndReqRespWireFormatHandler"/>
<destination jndiName="jms/SCA_JMS_Request3"/>
<connectionFactory jndiName="jms/SCA_JMS_CF"/>
<response>
<ts:wireFormat.jmsText/>
<destination jndiName="jms/SCA_JMS_Response3"/>
<connectionFactory jndiName="jms/SCA_JMS_CF"/>
</response>
</binding.jms>
</reference>
</component>
Component configuration for a service that uses jmsText wire format for the response and a jmsCustom format for the binding
OSOA
<component name="BackEndWireFormatHandlerReqRespWFComponent">
<implementation.java class="com.ibm.test.soa.sca.backend.CustomReqRespBackEndComponent"/>
<service name="CustomReqResp">
<binding.jms>
<destination name="jms/SCA_JMS_Request3" type="queue" create="never"/>
<activationSpec name="jms/SCA_JMS_AS3"/>
<response>
<destination name="jms/SCA_JMS_Response3"/>
<connectionFactory name="jms/SCA_JMS_CF" create="never"/>
<ts:wireFormat.jmsText/>
</response>
<ts:wireFormat.jmsCustom class="com.ibm.test.soa.sca.backend.custom.BackendReqRespDBH"/>
</binding.jms>
</service>
</component>
<component name="BackEndWireFormatHandlerReqRespWFComponent">
<implementation.java class="com.ibm.test.soa.sca.backend.CustomReqRespBackEndComponent"/>
<service name="CustomReqResp">
<binding.jms>
<ts:wireFormat.jmsCustom class="com.ibm.test.soa.sca.backend.custom.BackendReqRespDBH"/>
<destination jndiName="jms/SCA_JMS_Request3" type="queue" create="never"/>
<activationSpec jndiName="jms/SCA_JMS_AS3"/>
<response>
<ts:wireFormat.jmsText/>
<destination jndiName="jms/SCA_JMS_Response3"/>
<connectionFactory jndiName="jms/SCA_JMS_CF" create="never"/>
</response>
</binding.jms>
</service>
</component>
Deploy and test the wire format configuration in your SCA application.