perldoc > SOAP::Trace

📖 NAME

SOAP::Trace - used only to manage and manipulate the runtime tracing of execution within the toolkit

🚀 Quick Reference

Use CaseCommandDescription
Enable all tracinguse SOAP::Lite +trace => 'all';Enables all trace signals
Enable tracing with specific signalsuse SOAP::Lite +trace => [ qw(method fault) ];Enable only method and fault signals
Disable certain signalsuse SOAP::Lite +trace => [ qw(all -transport) ];Enable all except transport
Use callbacks for signalsuse SOAP::Lite +trace => [ fault => \&callback ];Route fault signals to a custom subroutine
Log faults to filesub log_faults { open LOG, ">fault.log"; print LOG shift; close LOG }Write fault messages to a log file
Inspect HTTP messagesuse SOAP::Lite +trace => [ transport => \&log_message ];Capture request/response objects
Debug with on_debug$client->on_debug( sub { print @_; } );Print debug output

📝 DESCRIPTION

This class has no methods or objects. It is used only to manage and manipulate the runtime tracing of execution within the toolkit. In absence of methods, this section reviews the events that may be configured and the ways of configuring them.

📋 SYNOPSIS

Tracing is enabled by the SOAP::Lite import method. This is usually done at compile-time, though it may be done explicitly by calling import directly. The commands for setting up tracing start with the keyword +trace. Alternately, +debug may be used; the two are interchangeable. After the initial keyword, one or more of the signals detailed here may be specified, optionally with a callback to handle them. When specifying multiple signals to be handled by a single callback, it is sufficient to list all of them first, followed finally by the callback, as in:

use SOAP::Lite +trace =>
  method => fault => \&message_level,
  trace => objects => \&lower_level;

In the fragment, the reference to message_level is installed as the callback for both method and fault signals, while lower_level is installed for trace and object events. If callbacks aren't explicitly provided, the default tracing action is to log a message to Perl's STDOUT file descriptor. Callbacks should expect a one or more arguments passed in, though the nature of the arguments varies based on the signal.

Any signal can be disabled by prefacing the name with a hyphen, such as -result. This is useful with the pseudosignal "all," which is shorthand for the full list of signals. The following fragment disables only the two signals, while still enabling the rest:

SOAP::Lite->import(+trace => all => -result => -parameters);

If the keyword +trace (or +debug) is used without any signals specified, it enables all signals (as if all were implied).

The signals and their meaning follow. Each also bears a note as to whether the signal is relevant to a server application, client application, or both.

🔍 TRACE SIGNALS

💡 EXAMPLES

SELECTING SIGNALS TO TRACE

The following code snippet will enable tracing for all signals:

use SOAP::Lite +trace => 'all';

You can disable tracing for a set of signals by prefixing the signal name with a hyphen. Therefore, if you wish to enable tracing for every signal EXCEPT transport signals, then you would use the code below:

use SOAP::Lite +trace => [ qw(all -transport) ];

LOGGING SIGNALS TO A FILE

You can optionally provide a subroutine or callback to each signal trace you declare. Each time a signal is received, it is passed to the corresponding subroutine. For example, the following code effectively logs all fault signals to a file called fault.log:

use SOAP::Lite +trace => [ fault => \&log_faults ];

sub log_faults {
  open LOGFILE,">fault.log";
  print LOGFILE, $_[0] . "\n";
  close LOGFILE;
}

You can also use a single callback for multiple signals using the code below:

use SOAP::Lite +trace => [ method, fault => \&log ];

LOGGING MESSAGE CONTENTS

The transport signal is unique in that the signal is not a text string, but the actual HTTP::Request being sent (just prior to being sent), or HTTP::Response object (immediately after it was received). The following code sample shows how to make use of this:

use SOAP::Lite +trace => [ transport => \&log_message ];

sub log_message {
  my ($in) = @_;
  if (class($in) eq "HTTP::Request") {
    # do something...
    print $in->contents; # ...for example
  } elsif (class($in) eq "HTTP::Response") {
    # do something
  }
}

ON_DEBUG

The "on_debug" method is available, as in:

use SOAP::Lite;
my $client = SOAP::Lite
  ->uri($NS)
  ->proxy($HOST)
  ->on_debug( sub { print @_; } );

🙏 ACKNOWLEDGEMENTS

Special thanks to O'Reilly publishing which has graciously allowed SOAP::Lite to republish and redistribute large excerpts from Programming Web Services with Perl, mainly the SOAP::Lite reference found in Appendix B.

ÂŠī¸ COPYRIGHT

Copyright (C) 2000-2004 Paul Kulchenko. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

👤 AUTHORS

SOAP::Trace
📖 NAME 🚀 Quick Reference 📝 DESCRIPTION 📋 SYNOPSIS 🔍 TRACE SIGNALS 💡 EXAMPLES
SELECTING SIGNALS TO TRACE LOGGING SIGNALS TO A FILE LOGGING MESSAGE CONTENTS ON_DEBUG
🙏 ACKNOWLEDGEMENTS ÂŠī¸ COPYRIGHT 👤 AUTHORS

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-29 16:20 @216.73.216.250
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^