I am trying to create a WCF Streaming Service. I have two requirements that I seem to be stumbling over trying to get this to work:
- Length of stream size
- Input parameters
My message contract looks like this:
[MessageContract]
public class MyStream
{
[MessageHeader]
public long StreamSize;
[MessageBodyMember]
public Stream StreamData;
}
My operation contract looks like this:
[ServiceContract]
public interface IStreamService
{
[OperationContract]
MyStream GetData(string data);
}
The error message I receive when trying to use the web service is this:
The operation 'GetData' could not be loaded because it has a parameter or return type of type System.ServiceModel.Channels.Message or a type that has MessageContractAttribute and other parameters of different types. When using System.ServiceModel.Channels.Message or types with MessageContractAttribute, the method must not use any other types of parameters.
From my understanding of this post, I need to use a message contract to get the length of my stream, but when I switch from a data contract to a message contract I am no longer allowed to pass in input parameters.
Is there a configuration change I'm missing? Or something else I can try? Thanks!