WCF Stream Post有多个参数?

时间:2014-02-01 14:20:17

标签: wcf

[ServiceContract(Namespace = "http://www.guruetech.com")]
public interface IService
{
    [OperationContract]
    UploadResult Upload(Stream itemStream); // succeeded!

    [OperationContract]
    UploadResult Upload(Stream itemStream, string theParameter); // failed!!!
}

[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.PerCall)]
public class Service : IService
{
    public UploadResult Upload(Stream itemStream)
    {
    }
    public UploadResult Upload(Stream itemStream, string theParameter) { } // failed!!!
}

1 个答案:

答案 0 :(得分:2)

来自MSDN Streaming Message Transfer

“对流式传输的限制

使用流式传输模式会导致运行时强制执行其他限制。

流式传输中发生的操作可以与最多一个输入或输出参数签订合同。“