Skip Menu |
 

This queue is for tickets about the SOAP-Lite CPAN distribution.

Report information
The Basics
Id: 22034
Status: rejected
Priority: 0/
Queue: SOAP-Lite

People
Owner: Nobody in particular
Requestors: NIKC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Pretty printing XML when tracing
Download (untitled) / with headers
text/plain 905b
SOAP::Lite's tracing facility is very useful, but it's diminished because it traces the XML sent back and forth directly. I've been working with a remote service that sends a large unformatted block of XML that was difficult to diagnose. I worked around it with this snippet of code. my $can_xml_tidy = eval { require XML::Tidy; 1; }; sub trace { if(shift) { SOAP::Lite->import(+trace => [ debug => \&_log ]); } else { SOAP::Lite->import(+trace => -all); } return; } sub _log { my $in = shift; my($header, $body) = split(/\n\n/, $in); print $header, "\n\n"; if($can_xml_tidy) { my $tidy = XML::Tidy->new(xml => $body); $tidy->tidy(); print $tidy->toString(); } else { print $body; } } So, if XML::Tidy's installed it's used to pretty-print the dumped XML. Would you consider adding this functionality as an option (off by default)?
Download (untitled) / with headers
text/plain 658b
Hi, in my opinion, it's useless. If you need formatted XML, your favorite XML editor is much better than any terminal formatting - and if the XML is short enough to be read on a terminal page, you probably don't need it formatted either. Moreover, reformatting XML responses might be misleading: Formatting XML means introducing ignorable whitespace. As SOAP::Lite can't know whether a part of XML may contain ignorable whitespace or not, it could print out invalid responses by inserting whitespace where it should not. I'd suggest a good XML editor, or maybe some logfile processor which detects and pretty-prints SOAP messages. Regards, Martin


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.