Hello, SOAP!

With Apache SOAP now installed, we’re ready to tackle our first SOAP application, “Hello, SOAP!” The “Hello, SOAP!” service provides a single sayHello( ) method, which accepts a first-name parameter and returns a personalized greeting. We’ll begin by exploring the general architecture outlined in Figure 4-3. This diagram includes all the elements responsible for processing data and traces the steps of a sample “Hello, SOAP!” conversation.

  1. The Apache SOAP client generates a SOAP request and sends the request via an HTTP POST. The client request specifies the helloservice service and the sayHello method. The request also includes a single parameter called firstName.

  2. The Jakarta Tomcat server receives the incoming request and forwards it to the Apache rpcrouter servlet.

  3. The rpcrouter looks up the requested helloservice, instantiates a HelloService object, and invokes the sayHello( ) method.

  4. The HelloService object extracts the firstName parameter (e.g., “Amy”) and returns a greeting (e.g., “Hello, Amy!”).

  5. The rpcrouter captures the greeting, packages the result into a SOAP response, and returns the response to the client.

Apache SOAP architecture
Figure 4-3. Apache SOAP architecture

Get Web Services Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.