随笔分类 -  WCF

摘要:今天写WCf 时遇到如下报错:调试过程发现,各个过程都无异常,但是返回给调用端数据时出现如下错误。Failed to invoke the service. Possible causes: The service is offline or inaccessible; the client-sid... 阅读全文
posted @ 2015-05-19 16:35 b0b0 阅读(957) 评论(0) 推荐(0)
摘要:客户端调用WCF服务可以通过添加服务引用的方式添加,这种方式使用起来比较简单,适合小项目使用。服务端与服务端的耦合较深,而且添加服务引用的方式生成一大堆臃肿的文件。本例探讨一种使用接口的方式使用WCF服务,克服通过服务引用方式产生的弊端。同时希望抛砖引玉,探讨更好的方式使用WCF。1. 架构概述解决方案说明:接口层:数字计算接口服务实现层:实现数字计算接口发布:同过IIS方式发布WCF服务客户端:引用接口层,通过配置文件调用WCF服务2. 接口层usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Te 阅读全文
posted @ 2011-08-19 21:53 b0b0 阅读(1506) 评论(1) 推荐(1)
摘要:WCF 异步调用说明: WCF客户端异步调用与服务端代码没有关系,只是和客户端的代码有关系。服务端服务接口:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.ServiceModel;namespaceConsoleAsyService{///<su 阅读全文
posted @ 2011-02-10 10:52 b0b0 阅读(556) 评论(0) 推荐(1)
摘要:WCF 承载服务 WinForm 承载 WCF 服务端 服务代码 服务接口: namespace WCFService { [ServiceContract] public interface IServiceWindow { [OperationContract(IsOneWay=false)] string GetCurrentTime(); } } 服务实现: using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serializa 阅读全文
posted @ 2011-02-10 10:49 b0b0 阅读(796) 评论(0) 推荐(1)