惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Stack Overflow Blog
Stack Overflow Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
大猫的无限游戏
大猫的无限游戏
爱范儿
爱范儿
WordPress大学
WordPress大学
B
Blog RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
J
Java Code Geeks
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
MyScale Blog
MyScale Blog
GbyAI
GbyAI
Martin Fowler
Martin Fowler
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 聂微东
The Cloudflare Blog
L
Lohrmann on Cybersecurity
Apple Machine Learning Research
Apple Machine Learning Research
I
InfoQ
Google DeepMind News
Google DeepMind News
S
Securelist
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 【当耐特】
Latest news
Latest news
T
Threatpost
量子位
Y
Y Combinator Blog
T
Troy Hunt's Blog
Know Your Adversary
Know Your Adversary
MongoDB | Blog
MongoDB | Blog
罗磊的独立博客
博客园_首页
AWS News Blog
AWS News Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
宝玉的分享
宝玉的分享
Project Zero
Project Zero
V
Visual Studio Blog
F
Fortinet All Blogs
S
Security Affairs
The Register - Security
The Register - Security
G
Google Developers Blog
T
Tenable Blog
L
LINUX DO - 最新话题
The GitHub Blog
The GitHub Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
博客园 - 三生石上(FineUI控件)
T
The Exploit Database - CXSecurity.com
博客园 - Franky

博客园 - IT Person

算法 《微软的秘密》读书笔记 经典思维50法 SQL Server 2008 T-SQL编程系列课程之常用查询算法比较 SQL Server 2008 T-SQL编程系列课程之T-SQL标准语法 ASP.NET 4风云之旅系列之ASP.NET 4对开发人员的核心运行时新特性 ASP.NET 4 风云之旅系列之ASP.NET MVC 2的新特性 ASP.NET 4 风云之旅系列之Visual Studio 2010在Web开发方面的新特性 ASP.NET开发实践系列课程之Web应用的安全攻防之网页木马 ASP.NET开发实践系列课程之ASP.NET综合调优 从架构设计到系统实施-基于Windows Server 2008的全新企业应用之Card Space身份验证 从架构设计到系统实施-基于.NET 3.0的全新企业应用之开发Vista边栏应用 从架构设计到系统实施-基于.NET 3.0的全新企业应用之开发基于MMC 3.0的管理工具 从架构设计到系统实施-基于.NET 3.0的全新企业应用之加入Silverlight支持 从架构设计到系统实施-基于.NET 3.0的全新企业应用之设计基于WPF的客户端 从架构设计到系统实施-基于.NET 3.0的全新企业应用之设计基于AJAX和IIS7的网站 - IT Person 从架构设计到系统实施-基于.NET 3.0的全新企业应用之设计基于WF的工作流 深度剖析Workflow Foundation之Workflow Activities 深度剖析Workflow Foundation之开发流程(下)
从架构设计到系统实施-基于.NET 3.0的全新企业应用之基于WCF的系统服务 - IT Person
IT Person · 2010-02-26 · via 博客园 - IT Person

系统架构设计
什么是WCF
一组用来创建软件服务的.NET 2.0类
 约定(两边的接口)
 绑定
 地址

如何使用WCF
服务器端
 开发人员定义约定
 开发人员实现约定
 开发人员提供服务
 IT人员配置绑定
 IT人员配置地址
 IT人员监控系统
客户端
 开发人员下载Metadata
 开发人员生成Proxy
 开发人员调用Proxy
 IT人员生成绑定
 IT人员生成地址
 IT人员监控系统

IService1.cs

[DataContract(Name="ProspectiveDeal", Namespace="WoodgroveBank")]
public class Deal
{
 [DataMember(Name="StockSymbols")]
 public string[] symbols;
 [DataMember(Name="Date")]
 private DateTime _when;

 public DateTime When { get { return this._when; } }
}

[DataContract(Name="DealAnalysis", Namespace="WoodgroveBank")]
public class Analysis
{
 [DataMember]
 public decimal Value;
 [DataMember]
 public decimal RiskFactor;
}

[ServiceContract(Name="DealService", Namespace="WoodgroveBank")]
public interface IDeal
{
 [OperationContract(Name="Analyze")]
 Analysis AnalyzeDeal(Deal dealToAnalyze);

 [OperationContract(Name="Execute", IsOneWay=true)]
 void ExecuteDeal(Deal dealToAnalyze);
}

Service1.cs
public class DealAnalyzer : IDeal
{
 Analysis IDeal.AnalyzeDeal(Deal dealToAnalyze)
 {
  Analysis a = new Analysis();
  return a;
 }

 void IDeal.ExecuteDeal(Deal dealToExecute)
 {
  System.Threading.Thread.sleep(3000);
 }
}

public class DealAnalyzer1 : IDeal
{
 Analysis IDeal.AnalyzeDeal(Deal dealToAnalyze)
 {
  Analysis a = new Analysis();
  return a;
 }

 void IDeal.ExecuteDeal(Deal dealToExecute)
 {
  System.Threading.Thread.sleep(3000);
 } 
}

ConsoleApplication
class Program
{
 static void Main(string[] args)
 {
  using(ServiceHost host = ServiceHost(typeof(DealAnalyzer)))
  {
   host.Open();
   Console.WriteLine("The service is running, Press any key to stop");
   Console.RaadLine();
  }
  finally
  {
   host.Close();
  }
 }
}