XML::C...::Trace(3pm)
β¨ NAME β¨
XML::Compile::SOAP::Trace β bestie, this is the little help module that lets you actually see your trace details π
(it's a 3pm page from the User Contributed Perl Documentation, and we are obsessed)
πΈ SYNOPSIS πΈ
my ($answer, $trace) = $call->(%params);
# now $trace is a XML::Compile::SOAP::Trace
my $req = $trace->request; # HTTP message which was sent
my $res = $trace->response; # HTTP message received
my $start = $trace->date;
my $dura = $trace->elapse;
$trace->printTimings;
$trace->printErrors;
$trace->printTimings(\*STDERR);
$trace->printRequest(pretty_print => 1);
$trace->printResponse;
π¦ DESCRIPTION π¦
okay so this help module is literally here to make your life easier when you wanna get at the trace data π«Ά β the stuff that gets produced by a SOAP call (client side, iykyk).
π METHODS π
π Constructors
XML::Compile::SOAP::Trace->new(%options)β this one gets called by the SOAP call implementation itself, so ngl it's not for normal users π like it's giving internal business only.
π Accessors
$obj->date()β hands you back the date string that represents the exact moment the call was initiated β°$obj->elapse( [$kind] )β returns the time in seconds (with hires, sub-second detail β¨) of a part of the SOAP communication. Heads up bestie: some values may beundefπ Elapse with no argument will return the total time elapsed.
As KINDs are defined "encode" (the time required by the translator build by XML::Compile::Schema to translate Perl into an XML::LibXML tree), "transport", and "decode" (from XML::LibXML tree into Perl)>. The transport components are also provided separately, as "stringify" (by XML::LibXML to convert a tree into text), "connect" (for the network message exchange by HTTP::Daemon), and "parse" (parsing answer string into XML)
See printTimings().
example:
print $trace->elapse('decode');
$obj->error( [$error] )β often contains an error message when something went wrong π The message is returned asLog::Report::Exception. Only the first error is returned, so useerrors()if you wanna get all of them.
[2.31] When an $error is provided, it is added to the internal list of errors. The $error parameter may be a Log::Report::Exception, a Log::Report::Message or a simple string.
$obj->errors()β[2.31]Return all errors, which areLog::Report::Exceptionobjects. See alsoerror().$obj->request()β returns theHTTP::Requestobject used for this SOAP call π₯ This might be quite useful during debugging, because a lot of the processing is hidden for the user... but you may want to see or log what is actually begin send π$obj->response()β returns theHTTP::Responseobject, returned by the remote server. In some erroneous cases, the client library will create an error response without any message was exchanged π$obj->responseDOM()β returns theXML::LibXML::Documenttop node of the response: the parsed text of the content of the received HTTP message π$obj->start()β returns the (platform dependent) time value which represent the moment that the call was initiated β±οΈ SeeTime::HiResmethod"time".
π§ Printing
$obj->printErrors( [$fh] )β the filehandle defaults toSTDERR.
If you want to see more output, try adding "<use Log::Report mode =" 3;>>
$obj->printRequest( [$fh], %options )
-Option --Default
pretty_print 0
pretty_print => 0|1|2β UseXML::Compile::Transport::compileClient(xml_format)if you want the messages to be shown readible. The digits reflectXML::LibXMLformat settings:'0'is unchanged,'1'will show indented formatting, and'2'has even more whitespace in it β¨
$obj->printResponse( [$fh], %options )
-Option --Default
pretty_print 0
pretty_print => 0|1|2β UseXML::Compile::Transport::compileClient(xml_format)if you want the messages to be shown readible π
$obj->printTimings( [$fh] )β Print an overview on various timings to the selected filehandle π
π SEE ALSO π
This module is part of XML-Compile-SOAP distribution version 3.28, built on August 01, 2022. Website: http://perl.overmeer.net/CPAN/ π
β LICENSE β
Copyrights 2007-2022 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/
and that's the whole page bestie, no cap, we ate π β¨
okay so the sign-off tea π: this was written for perl v5.34.0, dated 2022-08-04, and it's the XML::C...::Trace(3pm) page β slay, go forth and trace responsibly π¦π
π¦ where this page comes from
- debian bookworm: libxml-compile-soap-perl 3.28+ds-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libxml-compile-soap-perl 3.28+ds-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libxml-compile-soap-perl 3.28+ds-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libxml-compile-soap-perl 3.28+ds-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libxml-compile-soap-perl 3.28+ds-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms