Loading ...
Sorry, an error occurred while loading the content.

escaping '<' characters in fault messages

Expand Messages
  • kgoess
    I was having problems getting at the faultstrings from my SOAP::Lite server, and found it s not dealing with special characters (
    Message 1 of 1 , Jul 20 12:00 PM
    • 0 Attachment
      I was having problems getting at the faultstrings from my SOAP::Lite
      server, and found it's not dealing with special characters ('<' or
      '&') in the fault messages, so they don't deserialize when they get
      to the client.

      If a SOAP::Lite server dies with a stacktrace, it'll include the
      original XML that set it off, so this should happen quite often. I
      don't remember seeing anybody mention it, and I've been reading the
      list for some time, am I missing something obvious?

      It seems like this should do the trick, right?

      --- SOAP/Lite.pm.orig 2004-07-20 11:56:29.512346216 -0700
      +++ SOAP/Lite.pm 2004-07-20 11:57:33.833567904 -0700
      @@ -2369,6 +2369,7 @@
      sub make_fault {
      my $self = shift;
      my($code, $string, $detail, $actor) = @_;
      + $string = "<![CDATA[$string]]>";
      $self->serializer->fault($code, $string, $detail, $actor ||
      $self->myuri);
      }
    Your message has been successfully submitted and would be delivered to recipients shortly.