File tree Expand file tree Collapse file tree
Kernel/GenericInterface/Transport/HTTP
scripts/test/GenericInterface/Transport/HTTP/SOAP Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ use PerlIO;
2929use HTTP::Status;
3030use Plack::Response;
3131use SOAP::Lite; # for enabling debugging import +trace => 'all'
32+ use Text::Trim qw( rtrim) ;
3233
3334# OTOBO modules
3435use Kernel::System::VariableCheck qw( :all) ;
@@ -212,6 +213,10 @@ sub ProviderProcessRequest {
212213 Data => $Content ,
213214 );
214215
216+ # Normalize Content by removing trailing white space.
217+ # This make SOAP::Lite work with XML::Parser >= 1.48.
218+ rtrim($Content );
219+
215220 # Deserialize data.
216221 my $Deserialized = eval { SOAP::Deserializer-> deserialize($Content ); };
217222 my $DeserializedFault = $@ || ' ' ;
Original file line number Diff line number Diff line change 1414# along with this program. If not, see <https://www.gnu.org/licenses/>.
1515# --
1616
17+ use v5.24;
1718use strict;
1819use warnings;
19- use v5.24;
2020use utf8;
2121
2222# core modules
@@ -104,6 +104,10 @@ plan( scalar @Tests );
104104
105105for my $Test (@Tests ) {
106106
107+ # This test request XML has a trailing newline. There have been problems with that
108+ # when XML::Parser >= 1.48 is used.
109+ # Therefore Kernel::GenericInterface::Transport::HTTP::SOAP::ProviderProcessRequest()
110+ # has been tweaked to trim trailing white space.
107111 my $Request = << "END_XML" ;
108112<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tic="http://www.otobo.org/TicketConnector/">
109113 <soapenv:Header/>
@@ -114,7 +118,6 @@ for my $Test (@Tests) {
114118 </soapenv:Body>
115119</soapenv:Envelope>
116120END_XML
117-
118121 $EncodeObject -> EncodeOutput( \$Request );
119122
120123 # Fake STDIN and fill it with the request.
You can’t perform that action at this time.
0 commit comments