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.
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.The Jakarta Tomcat server receives the incoming request and forwards it to the Apache
rpcrouter
servlet.The
rpcrouter
looks up the requested helloservice, instantiates aHelloService
object, and invokes thesayHello( )
method.The
HelloService
object extracts thefirstName
parameter (e.g., “Amy”) and returns a greeting (e.g., “Hello, Amy!”).The
rpcrouter
captures the greeting, packages the result into a SOAP response, and returns the response to the client.
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.