3687Re: [soaplite] Problem with binary file
- Jun 20, 2004On 20-06-2004 at 11:25:38 leiandding <leiandding@...> wrote:
>Hello all,I am not sure that this is really doing what you want. I think that your file will be still returned as multiple lines but without any \r\n mangling.
> 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:");
> open(APPFILE,$filename) || die("Can not open the file");
To read all the content of a file into a variable
local $/ = undef;
$content = <APPFILE>;
> # print(@content); it can print the content of the file.You are passing several parameters to testUpload(), one for each line in your file, not just one.
> $session->testUpload(@content) || die("Can not Upload");
my $result = $session->testUpload(
SOAP::Data->name(content => $content)->type('base64');
You probably need to look at the logs on your server to see exactly what is being sent.
- << Previous post in topic