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

2795PHP NuSOAP and SOAP::Lite

Expand Messages
  • jahuong
    Jul 9 7:45 AM
    • 0 Attachment
      When I try to send compressed requests to a modified version of
      NuSOAP that accepts gziped and deflated requests. I hit a snagged.


      I solved it by changing SOAP::Transport:HTTP.pm .

      The part that used to compress the payload looked like this

      my $compressed = !exists $nocompress{$endpoint} &&
      $self->options->{is_compress} &&
      ($self->options->{compress_threshold} || 0) <
      SOAP::Utils::bytelength $envelope;
      $envelope = Compress::Zlib::compress($envelope) if $compressed;

      After I had changed it, it looked like this.
      my $compressed = !exists $nocompress{$endpoint} &&
      $self->options->{is_compress} &&
      ($self->options->{compress_threshold} || 0) <
      SOAP::Utils::bytelength $envelope;
      my $httpout = Compress::Zlib::deflateInit();
      my ($output, $status) ;
      ($output, $status) = $httpout->deflate($envelope) ;
      ($output, $status) = $httpout->flush() ;
      $envelope = $output;
      #$envelope = Compress::Zlib::compress($envelope) if $compressed;

      Hmm I do not know why there is a difference in the first place
      between deflateinit and compress though. Hopefully someone can shed
      some light on this.