Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Finding the size of the reponse using SOAP::Lite

by AltBlue (Chaplain)
on Aug 07, 2008 at 23:02 UTC ( [id://703017]=note: print w/replies, xml ) Need Help??


in reply to Finding the size of the reponse using SOAP::Lite

for the RESTful ones, this is easy, i can just do content_length() on the LWP response.

content_length?! Take care, as it does not do what you might think: it just returns the value of the Content-Length header, which - of course - may be missing... or just plain wrong (as I've seen already too many wanna-be-smart web apps that have no idea about its meaning).

Is there an similar way to do this with SOAP::Lite?

Quite similar in fact, as SOAP::Lite uses the same LWP modules for HTTP transport.

The usual way to reach those HTTP::Response objects is to enable runtime tracing of transport events. Here's an example:

use strict; use warnings; use SOAP::Lite +trace => [ transport => sub { my ($in) = @_; return if ref $in ne 'HTTP::Response'; printf "Response length: %d bytes.\n", bytes::length( $in->con +tent ); } ]; my $sv = SOAP::Lite->new->service('.../foo.wsdl'); $sv->fooMethod( 'foo', 'bar' );

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://703017]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2025-05-23 17:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.