Re: grabbing bytelength?
- Just out of curiousity, can you get this information from your
webserver access logs? The outgoing response byte size is usually
recorded there. Right?
Otherwise, I am not sure what to say. SOAP::Lite does not give you
access to the HTTP::Request and HTTP::Response objects directly. If
there is a way, it is through a hack.
--- In firstname.lastname@example.org, "Rich" <krush_groover@y...> wrote:
> is there an easy way to grab the bytelength (Content-Length) of the
> outgoing http message... I'd like to dump it to a db to record any
> anomalies as most of my soap posts will be the same general size.
- On 2003.05.01 09:17 Byrne Reese wrote:
> Just out of curiousity, can you get this information from yourHe could get it there, yes, but only after the fact.
> webserver access logs? The outgoing response byte size is usually
> recorded there. Right?
> Otherwise, I am not sure what to say. SOAP::Lite does not give youI wouldn't exactly call it a hack-- you can sub-class
> access to the HTTP::Request and HTTP::Response objects directly. If
> there is a way, it is through a hack.
SOAP::Transport::HTTP::Server and define your own response() method. This gets
called when the server core is setting the HTTP::Response object to be
returned to the client. The HTTP::Response object passed in is what the
SOAP::Server core has prepared. You should be able to fetch the
'Content-Length' header, or just length() on the content() method. Then pass
the argument along to the super-class method with
"$self->SUPER::response($arg)". Note that this method can be called with no
argument, meaning that it is retrieving the response object. Then you'd just
go straight to the SUPER::response.
Not the be an obvious salesman, but I cover this in "Programming Web Services
with Perl" :-). Not this exact detail, but the general concept of sub-classing
the transport modules.
rjray@... http://www.rjray.org http://www.svsm.org
Any spammers auto-extracting addresses from this message will definitely want
to include uce@... and report@...