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

5783SOAP::Lite 0.69

Expand Messages
  • mmmbena1
    Jan 11, 2007
    • 0 Attachment

      We have been trying to make SOAP::Lite work for sending attachments to
      and from servers, and we have pretty much made everything work
      (including patching the code with the patch from sourceforge posted by
      Joerg Prante on 2006-11-12). The only problem we are now left with, is
      that our servers seem to include the request message's Content-Type
      header in its responses. In any permutation of input/output including
      attachments, this causes the response to be badly formed (either
      because it has the wrong content type, or the wrong MIME boundary string).

      Does anyone else have this problem? In all cases that we have tried so
      far, the response's Content-Type is simply a clone of the resquest's.

      Can anyone help?

      Dave Thorne

      ... Server code example ...


      use strict;
      use SOAP::Transport::HTTP;
      use MIME::Entity;

      my $server = SOAP::Transport::HTTP::CGI ->
      packager(SOAP::Packager::MIME->new) -> dispatch_to('runDSSP');
      $server -> serializer -> autotype(0);
      $server -> handle();

      BEGIN {

      use strict;
      use vars qw(@ISA);
      @ISA = qw(SOAP::Server::Parameters);

      sub runDSSP {

      my $self = shift;
      my $envelope = pop; # SOM!!!

      # Create temporary file
      my $rand = rand;
      my $tmp_input = "/tmp/dssp-$rand.pdb";

      # Save PDB data to temporary file
      open(INPUT, ">$tmp_input");

      # Execute DSSP
      my $output = `/usr/local/bin/dsspcmbi -na $tmp_input`;

      my $ent = build MIME::Entity
      'Type' => "text/plain",
      'Data' => $output,
      'Filename' => "dssp.out",
      'Disposition' => "attachment";;

      # Delete temporary file
      unlink $tmp_input;

      return $ent;

    • Show all 2 messages in this topic