MTOM Demo  Locate

Overview  Locate

The demo shows how to write Web services using MTOM technology to work with both small and very large amounts of data. In addition, this demo uses XML MIME schema constructs enabling correct passing of content type even if binary data are serialized as base64Binary content.

Applications that have to process very large amounts of data tend to suffer from performance problems. You can partially avoid this by using concurrent reading and writing of input and output. In SESJ, you can do this using the org.idoox.wasp.types.MessageAttachment class. This class is supported directly by SESJ. But if you want to use MTOM technology you have to use the org.idoox.wasp.types.MtomMessageAttachment class instead.

This demo contains a simple service which receives both a small and a very large amount of data. The received data are processed (in this case, they are printed to the system console) and processed data Adler 32 checksum is returned back to client.

This demo uses the "demo/advanced/MtomService" service endpoint.

To start, the client creates a chunk of both small and big amount of data. Both chunks of data are then sent to service. The service processes them and returns an Adler 32 checksum of processed bytes.

[Note]Note

This demo might not work correctly on some application servers due to their inability to communicate using chunked HTTP messages (sending the message by parts).

Demo Package Description  Locate

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

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

Server source code

src/demo/advanced/mtom/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 screen.

The demo can be run in two different ways:

Runtime Publishing  Locate

To use Runtime Publishing, follow these steps:

  1. Be sure that you have not started SESJ. Shut the server down if it has been started.

  2. Compile the server classes.

    Windows: run.bat make_server
    Linux: ./run.sh make_server
    
  3. Run MtomServer (it starts SESJ and publishes the MtomService class).

    Windows: run.bat run_server
    Linux: ./run.sh run_server (use a new terminal)
    

    You can look at service WSDL descriptions on http://localhost:6060/demo/advanced/MtomService/wsdl from your browser.

  4. Make the client classes.

    Windows: run.bat make_client
    Linux: ./run.sh make_client
    
  5. Run MtomClient (it calls MtomService).

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

Persistent Deployment  Locate

  1. Start the SESJ.

  2. Compile MtomService.

    Windows: run.bat make_service
    Linux: ./run.sh make_service
    
  3. Deploy MtomService on the SESJ.

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

    Windows: run.bat make_client
    Linux: ./run.sh make_client
    
  5. Run MtomClient (it calls MtomService).

    Windows: run.bat run_client
    Linux: ./run.sh run_client
    
  6. Undeploy MtomService from the SESJ.

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