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

server not return file attachments

Expand Messages
  • theanhnv20
    I sent a file attachment to server , but I return a file atttachment to client . my server code: sub echo3 { use MIME::Entity; my $self = shift;
    Message 1 of 1 , May 29, 2006
    • 0 Attachment
      I sent a file attachment to server , but I return a file atttachment
      to client .


      my server code:

      sub echo3 {
      use MIME::Entity;
      my $self = shift;
      my $envelope = pop;
      my ($info, $md5_check) = @_;

      my $file = "C:/Apache2/htdocs/mod_perl/hinh.gif";

      my $ent = MIME::Entity->build(Type => "image/gif",
      Encoding => "base64",
      Path => $file,
      Filename => "hinh.gif",
      Disposition => "attachment",
      Mode => 1);
      my $checksum = "Hello";
      return SOAP::Data->name("checksum" => $checksum),$ent;

      }

      my client code :

      #!/perl/bin/perl -w


      my $SOME_NAMESPACE="urn:Majordojo:TemperatureService";
      my $SOME_HOST="http://localhost/mod_perl/server1.cgi";

      use strict;
      use SOAP::Lite +trace => qw(debug);
      use MIME::Entity;
      use Digest::MD5 qw(md5 md5_hex md5_base64);

      my $soap = SOAP::Lite
      ->readable(1)
      ->uri($SOME_NAMESPACE)
      ->proxy($SOME_HOST);

      my $som = $soap->echo3;

      my $check = $som->result;
      print "CHECK= $checksum\n";

      foreach my $part (@{$som->parts})
      {
      $part->stringify;
      }

      At client , $som don't have file attachments.

      Who know this , give for me?
    Your message has been successfully submitted and would be delivered to recipients shortly.