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' );
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|