Example #1
0
        private void btnStartStreaming_Click(object sender, RoutedEventArgs e)
        {
            ChannelFactory <SLApp.Web.IWcfDownloadService> factory = new ChannelFactory <Web.IWcfDownloadService>("CustomBinding_IWcfDownloadService_StreamedResponse");

            SLApp.Web.IWcfDownloadService proxy   = factory.CreateChannel();
            SLApp.Web.DownloadRequest     request = new SLApp.Web.DownloadRequest();
            request.fileName = "test.bin";
            request.fileSize = 1000000000L; // ~1GB
            Message input = Message.CreateMessage(factory.Endpoint.Binding.MessageVersion, SLApp.Web.Constants.DownloadAction, request);

            proxy.BeginDownload(input, new AsyncCallback(this.DownloadCallback), proxy);
            this.AddToDebug("Called proxy.BeginDownload");
        }