=head1 NAME

XML::Compile::SOAP::Trace - help displaying trace details.

=head1 INHERITANCE

=head1 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->printRequest;
 $trace->printResponse;

=head1 DESCRIPTION

This help module simplifies user access to the trace data,
as produced by a SOAP call (client side).

=head1 METHODS

=head2 Constructors

XML::Compile::SOAP::Trace-E<gt>B<new>(OPTIONS)

=over 4

Called by the SOAP call implementation; not for normal users.

=back

=head2 Accessors

$obj-E<gt>B<date>

=over 4

Returns the date string which represent the moment that the call
was initiated.

=back

$obj-E<gt>B<elapse>([KIND])

=over 4

Returns the time in seconds (with hires, sub-second detail) of a part of
the SOAP communication. Some values may be C<undef>.  Elapse without
argument will return the total time elapsed.

As KINDs are defined C<encode> (the time required by the translator
build by XML::Compile::Schema to translate Perl into an XML::LibXML
tree), C<transport>, and C<decode> (from XML::LibXML tree into Perl)>.
The transport components are also provided seperately, as C<stringify>
(by XML::LibXML to convert a tree into text), C<connect> (for the network
message exchange by HTTP::Daemon), and C<parse> (parsing answer string
into XML)

See L<printTimings()|XML::Compile::SOAP::Trace/"Printing">.

example: 

 print $trace->elapse('decode');

=back

$obj-E<gt>B<request>

=over 4

Returns the HTTP::Request object 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.

=back

$obj-E<gt>B<response>

=over 4

Returns the HTTP::Response object, returned by the remote server.  In
some erroneous cases, the client library will create an error response
without any message was exchanged.

=back

$obj-E<gt>B<start>

=over 4

Returns the (platform dependent) time value which represent the moment
that the call was initiated.  See Time::HiRes method C<time>.

=back

=head2 Printing

$obj-E<gt>B<printRequest>

=over 4

=back

$obj-E<gt>B<printResponse>

=over 4

=back

$obj-E<gt>B<printTimings>

=over 4

Print an overview on various timings to the selected filehandle.

=back

=head1 SEE ALSO

This module is part of XML-Compile-SOAP distribution version 2.02,
built on February 15, 2009. Website: F<http://perl.overmeer.net/xml-compile/>

All modules in this suite:
L<XML::Compile>,
L<XML::Compile::SOAP>,
L<XML::Compile::SOAP12>,
L<XML::Compile::SOAP::Daemon>,
L<XML::Compile::Tester>,
L<XML::Compile::Cache>,
L<XML::Compile::Dumper>,
L<XML::Rewrite>,
and
L<XML::LibXML::Simple>.

Please post questions or ideas to the mailinglist at
F<http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile>
For life contact with other developers, visit the C<#xml-compile> channel
on C<irc.perl.org>.

=head1 LICENSE

Copyrights 2007-2009 by Mark Overmeer. 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 F<http://www.perl.com/perl/misc/Artistic.html>

