mbeijen / App-OTRS-CreateTicket

Create tickets in OTRS via the Ticket Connector from the command line (CLI).
12 stars 6 forks source link

Stop working after perl-SOAP-Lite upgrade #5

Open TitovLab opened 7 years ago

TitovLab commented 7 years ago

Many thanks for your work, very nice script. After update from CentOS 6.8 to 6.9 otrs.CreateTicket.pl stop working with error:

Content-Length header value was wrong, fixed at /usr/share/perl5/vendor_perl/LWP/Protocol/http.pm line

189, <> line 1. Could not create ticket.

ErrorCode: TicketCreate.InvalidParameter ErrorMessage: TicketCreate: Ticket->QueueID or Ticket->Queue parameter is invalid!

This error because /usr/share/perl5/vendor_perl/SOAP/Transport/HTTP.pm was updated with perl-SOAP-Lite-0.710.10-4.el6.noarch.rpm. Differences between old and new versions:

diff -r usr/share/perl5/vendor_perl/SOAP/Transport/HTTP.pm 
../4/usr/share/perl5/vendor_perl/SOAP/Transport/HTTP.pm
200,203c200,208
<             $envelope = pack( 'C0A*', $envelope )
<               if !$SOAP::Constants::DO_NOT_USE_LWP_LENGTH_HACK
<                   && length($envelope) != $bytelength;
<
---
>                       if ($] < 5.008) {
>                               $envelope = pack( 'C0A*', $envelope );
>                       }
>                       else {
>                               require Encode;
>                               $envelope = Encode::encode('UTF-8', $envelope);
>                       }
>             #  if !$SOAP::Constants::DO_NOT_USE_LWP_LENGTH_HACK
>             #      && length($envelope) != $bytelength;

Error only if use non-english symbols in Ticket->Queue.