远程WCF实现客户端调用服务端方法.rar

上传者: 15122897 | 上传时间: 2021-08-09 09:29:01 | 文件大小: 373KB | 文件类型: RAR
WCF
WCF通信预先客户端直接主动调用服务端的方法,从而获取服务端方法执行的结果;从而判断服务端方法执行是否成功。例如:运动控制与视觉进行通信,以前以TCP通信进行交互,需要过多的判断;而采用WCF通信,就允许运动控制直接调用视觉的执行方法,就可以执行视觉检测,再依据返回值就可以判断好坏,这样做会简化很多工作。
服务端IService1 是指定的通信接口,类名需添加[ServiceContract]特性,而方法名需添加 [OperationContract]特性。再用一个类去继承它,实现内部方法。在App.config配置中endpoint 、baseAddresses中address属性中指定通信的IP、端口号。(注意:服务端必须以管理员权限打开)
客户端(在服务端运行下),通过添加服务引用,就可获取服务,就可以实现服务引用。

文件下载

资源详情

[{"title":"( 64 个子文件 373KB ) 远程WCF实现客户端调用服务端方法.rar","children":[{"title":"WCF_Service_Success","children":[{"title":"ConsoleApp1.sln <span style='color:#111;'> 1.11KB </span>","children":null,"spread":false},{"title":".vs","children":[{"title":"ConsoleApp1","children":[{"title":"v15","children":[{"title":".suo <span style='color:#111;'> 53.50KB </span>","children":null,"spread":false},{"title":"Server","children":[{"title":"sqlite3","children":[{"title":"storage.ide-wal <span style='color:#111;'> 2.60MB </span>","children":null,"spread":false},{"title":"storage.ide-shm <span style='color:#111;'> 32.00KB </span>","children":null,"spread":false},{"title":"storage.ide <span style='color:#111;'> 4.00KB </span>","children":null,"spread":false},{"title":"db.lock <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"ConsoleApp1","children":[{"title":"Program.cs <span style='color:#111;'> 563B </span>","children":null,"spread":false},{"title":"IService1.cs <span style='color:#111;'> 514B </span>","children":null,"spread":false},{"title":"obj","children":[{"title":"Debug","children":[{"title":"TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"ConsoleApp1.exe <span style='color:#111;'> 5.50KB </span>","children":null,"spread":false},{"title":"DesignTimeResolveAssemblyReferencesInput.cache <span style='color:#111;'> 6.92KB </span>","children":null,"spread":false},{"title":"ConsoleApp1.pdb <span style='color:#111;'> 19.50KB </span>","children":null,"spread":false},{"title":"TempPE","children":null,"spread":false},{"title":"ConsoleApp1.csproj.FileListAbsolute.txt <span style='color:#111;'> 1.12KB </span>","children":null,"spread":false},{"title":"TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"ConsoleApp1.csproj.CoreCompileInputs.cache <span style='color:#111;'> 42B </span>","children":null,"spread":false},{"title":"TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"bin","children":[{"title":"Debug","children":[{"title":"ConsoleApp1.exe <span style='color:#111;'> 5.50KB </span>","children":null,"spread":false},{"title":"ConsoleApp1.exe.config <span style='color:#111;'> 1.60KB </span>","children":null,"spread":false},{"title":"ConsoleApp1.pdb <span style='color:#111;'> 19.50KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"ConsoleApp1.csproj <span style='color:#111;'> 2.61KB </span>","children":null,"spread":false},{"title":"App.config <span style='color:#111;'> 1.60KB </span>","children":null,"spread":false},{"title":"Service1.cs <span style='color:#111;'> 551B </span>","children":null,"spread":false},{"title":"Properties","children":[{"title":"AssemblyInfo.cs <span style='color:#111;'> 1.29KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"WindowsFormsApp1","children":[{"title":".vs","children":[{"title":"WindowsFormsApp1","children":[{"title":"v15","children":[{"title":".suo <span style='color:#111;'> 52.50KB </span>","children":null,"spread":false},{"title":"Server","children":[{"title":"sqlite3","children":[{"title":"storage.ide-wal <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"storage.ide-shm <span style='color:#111;'> 32.00KB </span>","children":null,"spread":false},{"title":"storage.ide <span style='color:#111;'> 708.00KB </span>","children":null,"spread":false},{"title":"db.lock <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"WindowsFormsApp1","children":[{"title":"Form1.Designer.cs <span style='color:#111;'> 1.99KB </span>","children":null,"spread":false},{"title":"Program.cs <span style='color:#111;'> 528B </span>","children":null,"spread":false},{"title":"app.config <span style='color:#111;'> 781B </span>","children":null,"spread":false},{"title":"obj","children":[{"title":"Debug","children":[{"title":"TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"WindowsFormsApp1.csproj.FileListAbsolute.txt <span style='color:#111;'> 2.08KB </span>","children":null,"spread":false},{"title":"DesignTimeResolveAssemblyReferencesInput.cache <span style='color:#111;'> 7.95KB </span>","children":null,"spread":false},{"title":"WindowsFormsApp1.csproj.CoreCompileInputs.cache <span style='color:#111;'> 42B </span>","children":null,"spread":false},{"title":"TempPE","children":[{"title":"Connected Services.ServiceReference1.Reference.cs.dll <span style='color:#111;'> 4.00KB </span>","children":null,"spread":false}],"spread":true},{"title":"WindowsFormsApp1.Form1.resources <span style='color:#111;'> 180B </span>","children":null,"spread":false},{"title":"WindowsFormsApp1.pdb <span style='color:#111;'> 31.50KB </span>","children":null,"spread":false},{"title":"TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"WindowsFormsApp1.csproj.GenerateResource.cache <span style='color:#111;'> 1012B </span>","children":null,"spread":false},{"title":"DesignTimeResolveAssemblyReferences.cache <span style='color:#111;'> 980B </span>","children":null,"spread":false},{"title":"WindowsFormsApp1.csprojAssemblyReference.cache <span style='color:#111;'> 15.79KB </span>","children":null,"spread":false},{"title":"WindowsFormsApp1.Properties.Resources.resources <span style='color:#111;'> 180B </span>","children":null,"spread":false},{"title":"WindowsFormsApp1.exe <span style='color:#111;'> 9.50KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"bin","children":[{"title":"Release","children":null,"spread":false},{"title":"Debug","children":[{"title":"WindowsFormsApp1.pdb <span style='color:#111;'> 31.50KB </span>","children":null,"spread":false},{"title":"WindowsFormsApp1.exe.config <span style='color:#111;'> 781B </span>","children":null,"spread":false},{"title":"WindowsFormsApp1.exe <span style='color:#111;'> 9.50KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"Form1.cs <span style='color:#111;'> 935B </span>","children":null,"spread":false},{"title":"Form1.resx <span style='color:#111;'> 5.68KB </span>","children":null,"spread":false},{"title":"WindowsFormsApp1.csproj <span style='color:#111;'> 4.79KB </span>","children":null,"spread":false},{"title":"Connected Services","children":[{"title":"ServiceReference1","children":[{"title":"service1.xsd <span style='color:#111;'> 2.43KB </span>","children":null,"spread":false},{"title":"configuration91.svcinfo <span style='color:#111;'> 20.39KB </span>","children":null,"spread":false},{"title":"Reference.svcmap <span style='color:#111;'> 2.04KB </span>","children":null,"spread":false},{"title":"service.xsd <span style='color:#111;'> 904B </span>","children":null,"spread":false},{"title":"service.wsdl <span style='color:#111;'> 4.01KB </span>","children":null,"spread":false},{"title":"Reference.cs <span style='color:#111;'> 3.33KB </span>","children":null,"spread":false},{"title":"configuration.svcinfo <span style='color:#111;'> 1.63KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"Properties","children":[{"title":"AssemblyInfo.cs <span style='color:#111;'> 1.30KB </span>","children":null,"spread":false},{"title":"Settings.Designer.cs <span style='color:#111;'> 1.08KB </span>","children":null,"spread":false},{"title":"Resources.resx <span style='color:#111;'> 5.48KB </span>","children":null,"spread":false},{"title":"Settings.settings <span style='color:#111;'> 249B </span>","children":null,"spread":false},{"title":"Resources.Designer.cs <span style='color:#111;'> 2.78KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"WindowsFormsApp1.sln <span style='color:#111;'> 1.12KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明