Hi, I have created a WCF service to stream files(download). Code for the service is below
public Stream GetCoverScan(List<string> productIDs)
{
FileStream stream = new FileStream("", FileMode.Open, FileAccess.Read);
return stream;
}
Can some one tell me how do i consume this on the client side. I have already created a proxy on client and i can see the method by creating an object of the service, but how do i read the stream.
Please advise
Configuration
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="StreamedHttp" transferMode="StreamedResponse"
maxReceivedMessageSize="67108864">
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="Streaming.Service1"
behaviorConfiguration="Streaming.Service1Behavior">
<endpoint address="" bindingConfiguration="StreamedHttp"
binding="basicHttpBinding" contract="Streaming.IService1">
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Streaming.Service1Behavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Contract
[ServiceContract]
public interface IService1
{
[OperationContract]
string GetData(string name);
[OperationContract]
System.IO.Stream GetCoverScan(List<string> productIDs);
}
bindings
</bindings>