Search code examples
.netsilverlightsilverlight-4.0wcf-ria-services

Get responseStream after writing a stream


I am a little confused about streaming with WebClient (WC)

  1. Data is available and I start WC.OpenWriteAsync(Uri) on Silverlight side. WORKS
  2. Data comes to my server and I can read data to my harddisc by reading the stream using context.Request.InputStream. WORKS
  3. Modified Data is uploading from Server by using Context.Response.OutputStream WORKS
  4. How to get this stream now in my Silverlight App?

WC in Silverlight side does not server any stream information of new data. I cannot download data from sever. If I start again with WC.OpenReadAsync(Uri) the WC does start a new request but does not download the data from server.

Regards


Solution

  • It is a rather bizare design choice to that WebClient. Its bizare because, in my experience, its a rare "POST" that only accepts content and doesn't send anything in return.

    You will need to use WebRequest directly to handle both post and response.