You can convert objects to a wire format, or serialize the objects, before transmitting them. You can serialize objects for applications that use the Service Component Architecture (SCA) default binding.
When using the default binding, objects are serialized to one of several wire formats before being sent. By default, objects are serialized to XML and sent as text over the wire. However, XML serialization occurs only with classes that are JAXB serializable. These classes require a default, no-argument constructor as well as getter and setter methods for each field.
To use non-JAXB serializable objects, you must specify a different wire format in the composite definition file. Specify the default binding element wireFormat.javaObject as a child element.
When wireFormat.javaObject is used, objects use Java serialization instead of XML and travel as a stream of bytes over the wire. This enables you to use, for example, non-JAXB serializable Enterprise JavaBeans with the default binding.
You have configured Java serialization over the default bindings for your SCA service or reference.
Using the incorrect wire format might cause a runtime exception in your application.
The following composite definition file configures Java serialization in the SCA default binding:
<?xml version="1.0" encoding="UTF-8"?> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://scajavaserialize" xmlns:sca="http://www.ibm.com/xmlns/prod/websphere/sca/1.0/2007/06" name="sca-java-serialize-backend"> <component name="SCAJavaSerializationBackendComponent"> <implementation.java class="test.bindings.sca.SerializeBackendImpl"/> <service name="SerializeBackendService"> <interface.java interface="test.bindings.sca.SerializeBackendService" callbackInterface="test.bindings.sca.SerializeCallback"> <binding.sca> <sca:wireFormat.javaObject/> </binding.sca> <callback> <binding.sca> <sca:wireFormat.javaObject/> </binding.sca> </callback> </service> </component> </composite>
Deploy your SCA component in an application.
In this information ...Related concepts
| IBM Redbooks, demos, education, and more(Index) |