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

3686Problem with binary file

Expand Messages
  • leiandding
    Jun 20, 2004
    • 0 Attachment
      Hello all,
      We are using EJB to provide a webservice which allows the Perl
      client to upload and "download data, which is actually stored in a
      temporary file on the server.
      The web service provides two methods: testUpload for uploading file
      and testDownload for downloading previously uploaded file.

      == Method Prototype in WSDL ==
      testUpload(xsd:base64Binary content)
      xsd:base64Binary testDownload()

      The testDownload method is just fine, but there are problems with
      testUpload. No errors are reported in the process, but the server just
      don't write the content into the file.
      Really confused with this problem ... Any suggestions are welcome.
      Thanks in advance!

      Here's the testUpload code:

      sub testUpload
      {
      print("Please enter the filename:");
      $filename=<STDIN>;
      chop($filename);
      print("\n\n-------------\n\nUploading..............");
      open(APPFILE,$filename) || die("Can not open the file");

      binmode(APPFILE);
      @content=<APPFILE>;
      # print(@content); it can print the content of the file.
      close(APPFILE);
      $session->testUpload(@content) || die("Can not Upload");
      print("\nApp is created ");
      <STDIN>;
      }


      Cheers
      layman
    • Show all 2 messages in this topic