Using SOAP::Lite to access a web service, I'm getting:
not well-formed (invalid token) at ... XML/Parser.pm line 187

Indeed, the response XML is invalid. The ideal solution is to get the sending server to fix that, but that is unlikely to happen any time soon.

In the meantime, I was wondering if anyone knows a way to pre-process the response XML?

The response XML currently contains a null-byte (\0) that I would like to chop.
An example of what I mean:

>perl -e 'use SOAP::Lite; print SOAP::Deserializer->deserialize ( "<te +st>a</test>\0" );' not well-formed (invalid token) at line 1, column 14, byte 14 at /usr/ +lib64/perl5/vendor_perl/XML/Parser.pm line 187

My current calling code is standard:

use SOAP::Lite; my $client = SOAP::Lite->new( proxy => $proxy ); my $result = $client->call( $method => @arguments );

Thanks!


In reply to SOAP::Lite - preprocess response? by thewebsi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.