namespace SilverlightApplication1.Web { [ServiceContract] public interface IService1 { [OperationContract] Stream GetAStream( ); } }
public class Service1 : IService1 { public Stream GetAStream( ) { return new FileStream( @"C:\temp\hello.txt", FileMode.Open ); } }
public partial class MainPage : UserControl { public MainPage( ) { InitializeComponent(); ServiceReference1.Service1Client sc = new ServiceReference1.Service1Client(); sc.GetAStreamCompleted +=new EventHandler.ServiceReference1.GetAStreamCompletedEventArgs(sc_GetAStreamCompleted); } public void sc_GetAStreamCompleted (object sender, ServiceReference1.GetAStreamCompletedEventArgs e) { Byte[] bytes = e.Result; // I was hoping the result would be something like Stream xyz = e.Result ??? }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)