too long

I am using System.Net.WebClient client in .NET to post parameters for PHP web service. The PHP works and creates a file. How can i force the .NET client to wait to that file from php and get it.

  1. How would be better for the php to send it exatly to the service that called him?
  2. how can i wait for that file in my .Net client?

In PHP, do what You need to be able to create a file. Then create that file, get it contents and base64_encode the data. Create an XML (e.g.) and put in the filename, file mime_type and base64 encoded data...

It could look like this (supposing the file is already created and stored somewhere in temp, the filename is stored in variable $my_filename_with_extension and its mime_type is stored in variable $my_file_mime_type - should You ever need it...):

$data = base64_encode(file_get_contents(TEMP_DIR.$my_filename_with_extension));
$xml = '<'.'?xml version="1.0" encoding="UTF-8" ?'.'>';
$xml .= '<response>
    <filename>'.$my_filename_with_extension.'</filename>
    <mime_type>'.$my_file_mime_type.'</mime_type>
    <data>'.$data.'</data>
</response>';
echo $response;

Then in .NET application parse that XML and do whatever You need to do with the file data (base64 decode it to get the original file data).