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

4414Re: [soaplite] Attachments without Packager

Expand Messages
  • Byrne Reese
    Feb 10, 2005
      bezyan2 wrote:

      > Since the documentation for SOAP::Packager (on CPAN) indicates that
      > the "package" attribute is essentially deprecated, what is an
      > alternative method to attaching files?

      This is the recommended way:

      use SOAP::Lite;
      use MIME::Entity;
      my $ent = build MIME::Entity
      Type => "text/plain",
      Path => "attachment.txt",
      Filename => "attachment.txt",
      Disposition => "attachment";
      $NS = "urn:Majordojo:TemperatureService";
      $HOST = "http://localhost/cgi-bin/soaplite.cgi";
      my $client = SOAP::Lite
      ->parts([ $ent ])
      $response = $client->c2f(SOAP::Data->name("temperature" => '100'));
      print $response->valueof('//c2fResponse/foo');

      > I currently follow the existing online SOAP::Lite examples which
      > create a MIME entity, attach via the parts() method, and rely in
      > SOAP::Packager::MIME to deal with on server side of things.
    • Show all 2 messages in this topic