Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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?

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-06-24 18:53 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.