SOAP Messaging Demo  Locate

Overview  Locate

This demo shows how to perform simple SOAP messaging. For this demo, we create simple XML messages using a SOAP protocol that looks like the following:

<envelope>

	<header>
		<target>http://localhost:6060/messaging/Happy</target>
		<target>http://localhost:6060/messaging/Bashful</target>
		<target>http://localhost:6060/messaging/Sneezy</target>
		<target>http://localhost:6060/messaging/Sleepy</target>
		<target>http://localhost:6060/messaging/Grumpy</target>
		<target>http://localhost:6060/messaging/Dopey</target>
	</header>

	<body>
		<message>Hello Doc !!!</message>
	</body>

</envelope>

We have the message endpoints in the header section and a string message in the body section.

When the message arrives, each messaging service will:

  • print the message from the body of the arriving message.

  • obtain the target from the header.

  • create the new message with the rest of header.

  • put a new string message into the body of the outgoing message.

The Client creates the new message with all the endpoints and sends it to the first target. The message is then resent to the next target and so on.

If you are interested in running this demo over JMS transport, please see Running Demos Over JMS Transport.

Demo Package Description  Locate

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

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

Server source code

src/demo/advanced/messaging/client/

Client source code

src/package.xml

Deployment descriptor

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.

The demo can be run in two different ways:

Runtime publishing  Locate

To use Runtime Publishing, follow these steps:

  1. Ensure that you have not started SESJ.

  2. Compile the server classes.

    Windows: run.bat make_server
    Linux:   ./run.sh make_server
    
  3. Run MessagingServer (it starts SESJ and publishes MessagingService class).

    Windows: run.bat run_server
    Linux:   ./run.sh run_server (use a new terminal)
    
  4. Make the client classes.

    Windows: run.bat make_client
    Linux:   ./run.sh make_client
    
  5. Run MessagingClient (it calls MessagingService):

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

    If you wish to follow the progress of the invocation with SoapSpy, perform the following:

    1. Run server_java60/bin/soapspy.bat or soapspy.sh. This will bring up the SoapSpy GUI.

    2. Start spying by selecting Start Spying from the Spy menu or by clicking the spy icon in the main pane.

    3. Run the client using the run spy_client command instead of run_client.

Persistent deployment  Locate

To run using Persistent Deployment:

  1. Be sure that you have started SESJ.

  2. Compile MessagingService.

    Windows: run.bat make_service
    Linux:   ./run.sh make_service
    
  3. Deploy MessagingService 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 MessagingClient (it calls MessagingService).

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

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