MessageFormat Serialization Demo  Locate

Overview  Locate

This demo shows how to write a custom serializer and deserializer for RPC/encoded style.

For demo purposes a user needs to send a java.util.MessageFormat object which doesn't conform to java-beans' style. As a result, SESJ will not be able to access it's member data and send it via SOAP.

To create the demo, the following steps were performed:

Firstly, an XML Schema structure was created for the MessageFormat object (src/MessageFormat.xsd).

Secondly, the custom serializer and deserializer were created for the MessageFormat object (src/demo/advanced/messageformat/*.java).

Finally, the deployment descriptor (src/serialization_package.xml) is used to create the MessageFormat serialization package. This is deployed on the server and added to classpath on the client.

Both the client and the server side now work with MessageFormat and the custom serializers and deserializes. Therefore, both the client and the server are able to serialize (write text to XML) and deserialize (create appropriate MessageFormat object) the data correctly.

[Note]Note

This demo works for RPC/encoded style only. For document/literal style serialization please view the LongObject demo.

Demo Package Description  Locate

In addition to the files described in Files and Directories, this demo contains:

File or directoryDescription
src/demo/advanced/messageformat/server/

Server source code

src/demo/advanced/messageformat/client/

Client source code

Building and Running Demos  Locate

You can run the demo using the "run.sh" (for UNIX) or "run.bat" (for Windows) scripts. Running the script without arguments prints out a help message on screen.

This demo can ony be run using Persistent Deployment.

Persistent Deployment  Locate

To run using Persistent Deployment:

  1. Be sure that you've started the SESJ.

  2. Compile the custom serializers package.

    Windows: run.bat make_serializer_package
    Linux:   ./run.sh make_serializer_package
    
  3. Deploy the custom serializers package.

    Windows: run.bat deploy_serializer_package
    Linux:   ./run.sh deploy_serializer_package
    
  4. Compile MessageFormatService.

    Windows: run.bat make_service
    Linux:   ./run.sh make_service
    
  5. Deploy MessageFormatService on the SESJ.

    Windows: run.bat deploy_service
    Linux:   ./run.sh deploy_service
    
  6. Make the client classes.

    Windows: run.bat make_client
    Linux:   ./run.sh make_client
    
  7. Run MessageFormatClient (it calls MessageFormatService).

    Windows: run.bat run_client
    Linux:   ./run.sh run_client
    
  8. Undeploy MessageFormatService from the SESJ.

    Windows: run.bat undeploy_service
    Linux:   ./run.sh undeploy_service
    
  9. Undeploy the custom serializers package.

    Windows: run.bat undeploy_serializer_package
    Linux:   ./run.sh undeploy_serializer_package