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

Error sending attachments with SOAP::Lite, modification of non-creatable...

Expand Messages
  • il_puto_amo
    Hello, I m trying to send attachments using the SOAP::LITE and SOAP::MIME modules without success. I used an example from a website that seems to work but when
    Message 1 of 1 , Feb 21, 2007
    View Source
    • 0 Attachment
      Hello,

      I'm trying to send attachments using the SOAP::LITE and SOAP::MIME
      modules without success. I used an example from a website that seems
      to work but when I try to execute it in my computer it crashes with
      the following error:

      Modification of non-creatable array value attempted, subscript -1 at
      /usr/local/share/perl/5.8.7/SOAP/MIME.pm line 435.

      I have the version 0.69 of SOAP::LITE, the 0.55 of SOAP::MIME and the
      5.420 of MIME::Entity.


      The source code looks like:

      #!/usr/bin/perl

      use SOAP::Lite +trace => qw(debug);
      use SOAP::MIME;
      use MIME::Entity;

      my $ent1 = build MIME::Entity
      Type => "image/png",
      Encoding => "base64",
      Path => "attachments/reg-step1sm.png",
      Filename => "reg_step1sm.png",
      Disposition => "attachment";

      my $ent2 = build MIME::Entity
      Type => "text/xml",
      Path => "attachments/some.xml",
      Filename => "some.xml",
      Disposition => "attachment";

      push @attachments, $ent1;
      push @attachments, $ent2;

      my $som = SOAP::Lite
      ->readable(1)
      ->uri('http://webservices.imacination.com/distance/Distance.jws')
      ->parts(@attachments)
      ->proxy('http://webservices.imacination.com/distance/Distance.jws')
      ->getDistance(
      SOAP::Data->name('fromZip' => 94610)->type('string'),
      SOAP::Data->name('toZip' => 94105)->type('string')
      );

      Any ideas?
      Thanks a lot.

      Albert
    Your message has been successfully submitted and would be delivered to recipients shortly.