xml-soap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rich Johns <rjo...@vignette.com>
Subject 1st pass: http provider gets context
Date Mon, 14 Aug 2000 13:12:27 GMT
I've taken a stab at the first pass implementation of handing
off context to service providers over http. My experiments
absolutely require it, so I'd like to get this on the table for

The concept is that a service provider might require context information
that is normally available to a servlet. The changes I made try to honor
the concept of a loose coupling between the soap-layer and the provider
class. Here is a list of the changes I made, PLEASE  see the code for comments
rationale, and details. (I have attached the 2 files I changed: RPCRouterServlet.java
and RPCRouter.java). There are very few changes and I believe they are unobtrusive.


1. In RPCRouterServlet.java:

    - passing in the context to rpcRouter.invoke(...)

      // invoke the method on the target object. Pass into the rpcRouter a
      // context that can optionally be handed to the service provider.
      resp = rpcRouter.invoke (call, targetObject, makeHttpContext( req, context ) );

   - added a method called makeHttpContext which packages up the HttpServletRequest and
     the ServletContext in a HashMap.

2. In the RPCRouter.java:

    - only for provider types of  PROVIDER_JAVA I attempt to set the context on the
      provider instance:

     // before invoking call, offer context to target object
     setContext( targetObject, context );
     result = new Bean (m.getReturnType (), m.invoke (targetObject, args));

   - added a setContext method (please see code for comments and details)

--------------------------------------------end change

Jean-Noel, I almost put these changes in your code, as I believe the refactoring you are doing
is going in the right direction, but I decided to wait until you get farther
down the road. Actually, if you agree with these changes perhaps you could pick them up, they

extensive at all. If nothing else, I hope this first pass attempt gets the issue of provider

and context on the table. I realize my approach is specific for Http, but I'm not sure what
context means for other transports.


View raw message