[prev] [thread] [next] [lurker] [Date index for 2004/10/08]
On Oct 8, 2004, at 7:34 AM, David Cantrell wrote: > This is, even though it appears to work, AWFUL > software. Amen! /me Hallelujahs multiple times. My favorite SOAP::Lite hack is the need to create functions named for exception classes in the SOAP::Serializer namespace to catch one's own exceptions and serialize them to send to the client. Also completely undocumented. For those interested in how this works, using Exception::Class, I just do this: BEGIN { # Setup routines to serialize Exception::Class-based exceptions. It needs # to look like this (no, I'm not kidding): # sub SOAP::Serializer::as_Bric__Util__Fault__Exception__GEN { # [ $_[2], $_[4], escape_html($_[1]->error) ]; # } foreach my $ec (Exception::Class::Base->Classes) { $ec =~ s/::/__/g; eval qq{sub SOAP::Serializer::as_$ec { [ \$_[2], \$_[4], escape_html(\$_[1]->error) ]; }}; } } But that took forever to figure out! Regards, David
Generated at 06:01 on 27 Oct 2004 by mariachi 0.52