Apache SOAP itself contains a pair of servlets (RPCRouterServlet and
MessageRouterServlet).  The J2EE container in which they run routes HTTP
requests to them based on the request URL.  By default, most containers will
load the servlets and classes they require on demand, although many allow
you to specify that the servlets should be pre-loaded.  These servlets in
turn use the "target object URI" or "target namespace" and method name to
locate the class implementing the service (as specified in a deployment
descriptor), lookup or create an instance of that class, then invoke the
method.

I believe you are mainly asking about the "lookup or create an instance"
part of this process.  The details of this are controlled by the scope
specified in the deployment descriptor.  The scope can be application,
session or request.  For application scope, a single instance of the service
class is created the first time the service is called, and that instance is
used for all subsequent calls.  This is great for memory and CPU usage, but
has threading and state implications that may not always be acceptable.  For
session scope, one instance is created for each session (with sessions
maintained by the cooperation of J2EE container and SOAP client; some SOAP
clients may not support sessions) and stored in the session properties.
When the J2EE container destroys the session, the instance will become
eligible for garbage collection.  Finally, for request scope, an new
instance is created for each request, and the instance can be garbage
collected shortly after the method is called on the instance.

This stuff all happens in
org.apache.soap.server.http.ServerHTTPUtils#getTargetObject.

Scott Nichol

----- Original Message -----
From: "Hongda Lin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 13, 2002 9:11 AM
Subject: Is this the way SOAP works?


Hi,

            I know that SOAP uses HTTP 1.0. After a request/response the
HTTP session dies, but what about the code it was running on? Is it
running all the time once you register it, then it just waiting for
someone to call its method? Or every time someone request something from
SOAP, SOAP locates the executable, execute it, then kill it?



Thank you all,



Hongda




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to