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

5927file transfer

Expand Messages
  • s82martin
    Apr 16, 2007

      Hope someone can help with this problem - I am trying to construct a
      web service that accepts a file containing data as input, however I am
      struggling to understand how to do this. I have the following server:

      #!/usr/bin/perl -w

      use SOAP::Transport::HTTP;

      -> dispatch_to('Test')
      -> handle;

      package Test;

      sub test($) {

      my ($class, $file) = @_;

      return $file;

      and a corresponding client:

      #!/usr/bin/perl -w

      use SOAP::Lite;

      my $file = "file.txt";

      print SOAP::Lite
      -> uri('http://my.server/Test2')

      -> proxy('http://my.server/cgi-bin/test2.cgi')
      -> test($file)
      -> result;

      However when I run this client I just get the result "file.txt"
      printed i.e. it is printing the actual filename as opposed to the
      content of the file.

      Also, have I understood it correctly that subroutines can only return
      values using "return" and not "print"? At some point I want to be able
      to write a SOAP server which will be part of a bigger software
      pipeline, and it would be useful for me to be able to open filehandles
      from within the cgi script, but i don't seem to be able to do this either.

      Any help/advice with these issues would be great, many thanks.