项目包含一个 WCF 服务器, 以及一个 Winform 客户端,客户端通过硬编码实现 Binding 调用
源码点击这里查看
1. 添加 WCF service UpLoadService
,修改接口文件 IUpLoadService
如下
[ServiceContract]public interface IUpLoadService{ [OperationContract(Action = "UploadFile", IsOneWay = true)]void UploadFile(FileUploadMessage request);
<span class="token punctuation">[</span><span class="token function">OperationContract</span><span class="token punctuation">(</span>Action <span class="token operator">=</span> <span class="token string">"DownLoadFile"</span><span class="token punctuation">)</span><span class="token punctuation">]</span>DownFileResult <span class="token function">DownLoadFile</span><span class="token punctuation">(</span>DownFileRequest fileName<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span>