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

6223Apache::SOAP and returning MIME attachments

Expand Messages
  • lormidorido
    Sep 5, 2008
    • 0 Attachment
      Hi Paul and others on the list,

      I am sorry to bother you but having now been struggling for days with
      getting my SOAP::Lite server installation to return MIME attachment I
      see no other alternative then to resort to the mailing list.

      My problem is that I cannot understand how to specify to the
      Apache::SOAP server instance to use the package format
      SOAP::Lite::Packager::MIME.

      Basically, I want to know how to setup the equivalence of the
      following code (that shows how to use attachments within the context
      of a CGI script):

      #!/usr/bin/perl -w
      use SOAP::Transport::HTTP;
      use MIME::Entity;
      SOAP::Transport::HTTP::CGI
      ->packager(SOAP::Packager::MIME->new)
      ->dispatch_with({'urn:Majordojo:TemperatureService'
      => 'TemperatureService'})
      ->handle;

      BEGIN {
      package TemperatureService;
      use vars qw(@ISA);
      @ISA = qw(Exporter SOAP::Server::Parameters);
      use SOAP::Lite;
      sub c2f {
      my $self = shift;
      my $envelope = pop;
      my $temp = $envelope->dataof("//c2f/temperature");
      use MIME::Entity;
      my $ent = build MIME::Entity
      Type => "text/plain",
      Path => "printenv",
      Filename => "printenv",
      Disposition => "attachment";
      # read
      attachments

      foreach my $part (@{$envelope->parts}) {
      print STDERR "soaplite.cgi: attachment found! (".ref($part).")
      \n";
      print STDERR "soaplite.cgi: contents => ".$part-
      >stringify."\n";
      }
      # send
      attachments

      return SOAP::Data->name('convertedTemp' => (((9/5)*($temp-
      >value)) + 32)),
      $ent;
      }
      }

      … within the context of using attachments with a SOAP::Lite setup
      using Apache::SOAP.

      I use location bases access in my httpd.conf file:
      <Location /ides_soap>
      SetHandler perl-script
      PerlHandler Apache::SOAP
      PerlSetVar
      dispatch_to "IDES::new_matter,IDES::get_updated_matters,IDES::update_m
      atter,IDES::get_matter_status"
      PerlSetVar options "compress_threshold => 10000"

      </Location>

      Is it here that I somehow specify to Apache::SOAP to use the package
      format SOAP::Lite::Packager::MIME?

      Any help would be highly appreciated.

      Regards,
      Ragnar
    • Show all 2 messages in this topic