Re: [soaplite] How to access request and response in server method
- Hi, Peter!
It should be pretty easy to do with a database connection object
which is per server instance object as far as I understand. You can
do something like this:
my $server = SOAP::Transport::HTTP::Daemon->....;
$My::Server::db_handle = ....;
and you can access $My::Server::db_handle from your methods.
To get access to request/response object, you may override
request/response methods of SOAP::Server (or any inherited class,
like SOAP::Transport::HTTP::Daemon). Although there is no easy way to
pass this information down to your method. If you find the way, let
me know; for now your best bet is probably global variables, even if
won't work for non-sequential processing on server side. Let me know
if you find a better solution, I'll document it. Thanks.
Best wishes, Paul.
--- Peter Ehrenberg <pe@...> wrote:
> I wonder how to "global objects" make accessible for methods called__________________________________________________
> on server site. Any such global objects are for example:
> o a database connection object
> o the request object
> o the respond object
> The database connection is created by the early stage of the (my)
> program. It is permanent for any subsequent request and are used by
> nearly all called method.
> The request and response objects are created by the handle()-Method
> from the SOAP::Server class. I have to access them in my
> class to check and set http cookies.
> My question now is: What is the most elegant way to implement a
> path (or already exists one?), so that every by handle() called
> can use these objects?
> Dipl.-Ing. Peter Ehrenberg Tel.: (040)
> Rotenh�user Stra�e 51 Fax: (040)
> 21109 Hamburg Netz:
> ------------------------ Yahoo! Groups Sponsor
> To unsubscribe from this group, send an email to:
> Your use of Yahoo! Groups is subject to
Do You Yahoo!?
Yahoo! Shopping - Mother's Day is May 12th!