WCF学习系列一【WCF Interview Questions-Part 1 翻译系列】

WCF Interview Questions – Part 1

This WCF Tutorial is a collection of most frequently asked interview questions about Windows Communication Foundation (WCF) covering the beginner to professional level.

这个WCF教程,是WCF常见问题的集合,它主要面向WCF初学者的专业水平。

Following are the links to other posts in this WCF Questions Series:

下面是WCF系列问答教程中的一部分:

  1. WCF Service Interview Questions – Part 1
  2. WCF Service Interview Questions – Part 2
  3. WCF Service Interview Questions – Part 3
  4. WCF Service Interview Questions – Part 4

Note: Please look into the  Top 10 WCF Interview Questions also.

注意:同时请关注前10个WCF问题:  Top 10 WCF Interview Questions

 

frequently asked questions[FAQ]:常见问答

 

MCSD Exam: 70-487

  1. What is WCF?【什么是WCF】
  2. Why to use WCF? or What are the advantages of using WCF?【为什么要使用WCF,或者WCF有哪些优点】
  3. What are the core components of WCF Service?【WCF服务,核心的组件是?】
  4. What are the new features introduced in WCF 4.5?【WCF 4.5版本中介绍了哪些新特性】
  5. What is the difference between WCF and ASMX Web services?【WCF和ASMX Web服务之间的不同是什么?】
  6. What are the Endpoints in WCF? or Explain ABCs of endpoint?【WCF的节点是什么?或者解释一两点出来】
  7. What is the difference between Service EndPoint and Client Endpoint?【服务节点和客户端节点有什么不同?】
  8. What is a WCF Binding? How many different types of bindings available in WCF?【什么是WCF绑定,WCF中允许哪些类型的绑定?】
  9. What is WebHttpBinding in WCF?【WCF中WebHttpBinding是什么?】
  10. Can we have multiple endpoints for different binding types in order to serve different types of clients?【为了服务不同类型的客户端,我们可以有多个不同类型的绑定节点么?】
  11. What are the hosting options for WCF Services? Explain.【WCF的托管选项是什么?请解释。】

What is WCF?【什么是WCF】

Microsoft refers WCF as a programming platform that is used to build Service-Oriented applications. Windows Communication Foundation is basically a unified programming model for developing, configuring and deploying distributed services.  Microsoft has unified all its existing distributed application technologies (e.g. MS Enterprise Services, ASMX web services, MSMQ, .NET Remoting etc) at one platform i.e. WCF. Code name for WCF was Indigo. Below diagram clearly explains it:

      微软把WCF作为,用于构建面向服务的应用程序的编程平台。Windows Communication Foundation基本上是一个统一的编程模型开发、配置和部署分布式服务。微软统一了现有的分布式应用程序【例如MS Enterprise Services, ASMX web services, MSMQ, .NET Remoting 等等】集中在一个平台上,也就是WCF。为WCF取名为Indigo,下面的图表清晰的解释了:

Windows Communication Foundation

Why to use WCF? or What are the advantages of using WCF?

为什么使用WCF,它的优点是?

Advantages of WCF 支持面向服务的架构;简单、可靠、安全;便于协同操作;一个服务可以服务多个客户端;可扩展。

 

  • Service Orientation is one of the key advantages of WCF. We can easily build service-oriented applications using WCF.【面向服务是WCF关键的优点。我们使用WCF可以很简单的构建面向服务的应用程序。】
  • If compared with ASMX web services, WCF service provides reliability and security with simplicity.【和ASMX Web 服务相比,WCF服务提供了可靠性,安全性,简单性】
  • As oppose to .NET Remoting, WCF services are interoperable.【相对.NET Remoting,WCF服务是可以互操作的。】
  • Different clients can interact with same service using different communication mechanism. This is achieved by using service endpoints. A single WCF service can have multiple endpoints. So, developer will write code for service once and just by changing configuration (defining another service endpoint), it will be available for other clients as well.【不同的客户端,和同一个服务的交互,可以使用不同的通信机制。这可以通过使用服务节点实现。一个简单的WCF服务可以有多个节点。因此,开发者只需要写一次服务端的代码,然后仅仅通过改变配置(定义其他的服务节点),那么这个服务,将会同时可以被其他的客互端使用。】
  • Extensibility is another key advantage of WCF.  We can easily customize a service behavior if required.【可扩展是WCF另外一个关键性的优点,如果有需要的话,我们可以很简单的定制服务的行为。】

What are the core components of WCF Service?【WCF的关键组件是什么】

A WCF service has at least following core components.【一个WCF服务,至少需要下面的关键组件】
  • Service Class:  A service class implementing in any CLR-based language and expose at least one method.
        服务类:一个服务类是基于任何CLR基础的语言实现的,并且至少暴露一个方法。
  • Hosting Environment: a managed process for running service.
        托管环境:为运行服务管理进程。
  • Endpoint: a client uses it to communicate with service.
       节点:客户端使用节点和服务端通信。
  • Core WCF Components

What are the new features introduced in WCF 4.5?【WCF 4.5版本中介绍了哪些新特性】

Windows Communication Foundation v4.5 was released with a number of cool features. Here we simply list down most important features but you can find thorough detail about each feature with helping code snippet in  7 parts series of new features in WCF 4.5. These important features are:

Windows Communication Foundation v4.5发布了一些很酷的特点。这里我们仅仅列出最重要的特点,但是你可以从这篇文章中 7  parts series of new features in WCF 4.5.找到每个特性的深入细节的代码片段。这些重要的特性是:

  • Simplified Configuration files【简化的配置文件】
  • ToolTip and Intellisense support【工具提示和智能感知的支持】
  • Task-based asynchronous Programming Model【基于任务的异步编程模型】
  • BasicHttpsBinding support【BasicHttpsBinding支持】
  • Single WSDL Document【单个的WSDL文件】
  • WCF Configuration Validation【WCF配置验证】
  • ASP.NET Compatibility Mode changed【ASP.NET兼容模型改变】
  • Contract First Development【Contract First开发】
  • Multiple Authentication Types【多个身份验证类型】
  • XmlDictionaryReaderQuotas default value changed【XmlDictionaryReaderQuotas默认值改变】
  • UDP Transport Support【支持UDP传输】
  • and many more…【更多....】

For more on key WCF 4.5 features, please  follow here.【想要了解更多WCF 4.5的特性,请看这:   follow here】

What is the difference between WCF and ASMX Web services?【WCF和ASMX Web服务之间的不同是什么?】

The basic difference is that ASMX web service is designed to send and receive messages using SOAP over HTTP only. While WCF service can exchange messages using any format (SOAP is default) over any transport protocol (HTTP, TCP/IP, MSMQ, Named Pipes etc).ASMX Web Services Vs WCFYou can find detailed discussion on  WCF Vs ASMX Web services here.

基本区别是,ASMX web服务是使用HTTP上的SOAP,仅仅用于发送和接收消息。而WCF可以在任何传输协议(HTTP, TCP/IP, MSMQ, Named Pipes etc)上,使用任何格式(默认是SOAP)交换信息。在这儿, WCF Vs ASMX Web services ,你可以找到更多关于WCF和ASMX Web服务的讨论。

What are the Endpoints in WCF? or Explain ABCs of endpoint?【WCF的节点是什么?或者解释一两点出来】

For WCF services to be consumed, it’s necessary that it must be exposed; Clients need information about service to communicate with it. This is where service endpoints play their role.

随着WCF讨论的继续,很有必要弄清楚什么是WCF;客户端需要服务的信息来通信,这就是服务节点所扮演的角色。
A service endpoint has three basic elements or also called ABCs of an endpoint i.e. Address, Binding and Contract.

一个服务节点有三个基本的元素,或者称作ABCs节点,那就是Address, Binding and Contract.

ABC's of WCF EndPoint

  • AddressIt defines “WHERE”. Address is the URL that identifies the location of the service.
    Address:它定义了“哪里”,Address是一个URL,它定义了服务的位置。
  • BindingIt defines “HOW”. Binding defines how the service can be accessed.
        Binding:它定义了“怎样”,Binding定义了如何访问服务。
  • ContractIt defines “WHAT”. Contract identifies what is exposed by the service.
        Contract:它定义了“什么”。Contract确定了,服务公开了什么。
  • WCF Endpoint

What is the difference between Service EndPoint and Client Endpoint?【服务端节点和客户端节点有什么不同?】

As we already understood the concept of an Endpoint and it’s ABC (Address, Binding, Contract). Both Service and Client Endpoint has same ABC but we think in different perspective while working with them. We can differentiate between Service and Client Endpoint with respect to Address, Binding and Contract as:

我们已经理解了节点的概念,知道了它有ABCs-->【Address, Binding, Contract】,服务端节点和客户端节点都同样有ABCs,但是我们可以从不同的角度来思考、使用它们。我们可以根据 Address, Binding and Contract,从以下几个方面来区分服务端节点和客户端节点:

 

Service Endpoint【服务端节点】
Client Endpoint【客户端节点】
WHERE: URL of hosted service.【托管服务的URL】WHERE: where to connect with hosted service.【连接托管服务】
WHAT: bindings being used.【使用绑定】WHAT: binding supported by service.【服务支持的绑定】
CONTRACT: Service Contract i.e. interfaces【服务契约,例如接口。】CONTRACT: what to pass and expect while communicating with service.【和服务通信的时候传递,期望值

 

What is a WCF Binding? How many different types of bindings available in WCF?【什么是WCF绑定,WCF中允许哪些类型的绑定?】

Bindings in WCF actually defines that how to communicate with the service. Binding specifies that what communication protocol as well as encoding method will be used. Optionally, binding can specify other important factors like transactions, reliable sessions and security.
Another  WCF Tutorial gives more detailed understanding of Binding concept in WCF.

There are different built-in bindings available in WCF, each designed to fulfill some specific need.

     WCF中的Bindings,实际上定义了如何与服务进行通信.绑定指定了通信的协议还有使用的编码的方法。可选地,Binding可以指定其他重要因素,如事务,可靠的Sessions和安全性。另外的一片文章: WCF Tutorial给出了更多WCF中Binding概念的细节。

下面这些不同的内置绑定在WCF中,都是可行的,每一个都是实现一些特定的需要。

  • basicHttpBinding
  • wsHttpBinding
  • netNamedPipeBinding
  • netTcpBinding
  • netPeerTcpBinding
  • netmsmqBindingWCF Bindings

For details on different binding types, please follow the link to  WCF bindings.

想要了解很多不同的绑定类型,请看这个链接的文章: WCF bindings.

What is a WebHttpBinding in WCF?【WCF中WebHttpBinding是什么?】

WebHttpBinding is the one that is used for  creating WCF RESTful services. In Windows Communication Foundation v3.5, Microsoft introduces support for building RESTful services. REST (Representational State Transfer) is an architectural design that uses HTTP the way it should be used.

      WebHttpBinding 被用来创建: WCF RESTful services,在WCF 3.5中,微软就支持创建RESTful 服务。REST (Representational State Transfer)是一个使用HTTP的设计结构。

Instead of using HTTP just as a transport (in case of SOAP-based WCF Services),  RESTful WCF services uses full features of HTTP (for all CRUD Operations including Create, Retrieve, Update and Delete).

You can find WebHttpBinding in action as in below configuration screenshot.

      代替使用HTTP作为运输(在基于SOAP的WCF下),  RESTful WCF services uses full features of HTTP(可以做所有的CRUD操作,包括增删查改。)你可以在下面的配置中找到WebHttpBinding 。

WebHttpBinding

Can we have multiple endpoints for different binding types in order to serve different types of clients?【为了服务不同类型的客户端,我们可以有多个不同类型的绑定节点么?】

Yes, we can have multiple endpoints for different binding types. For example, an endpoint with wsHttpBinding and another one with netTcpBinging.
是的,对于不用的绑定类型,我们可以有多个节点。例如一个节点上带有wsHttpBinding ,另外一个节点上有netTcpBinging。

What are the hosting options for WCF Services? Explain.【WCF的托管选项是什么?请解释。】

For a service to host, we need at least a managed process, a ServiceHost instance and an Endpoint configured. Possible approaches for hosting a service are:

对于一个服务托管,我们至少需要一个管理进程,ServiceHost实例和一个节点配置。,下面的这些都是可以为服务托管的方法:

  • Hosting in a Managed Application/ Self Hosting【托管在一个托管的应用程序中/自我托管】
    • Console Application【控制台应用程序】
    • Windows Application【窗体应用程序】
    • Windows Service【Windows服务】
  • Hosting on Web Server【托管在Web服务器上】
    • IIS 6.0 (ASP.NET Application supports only HTTP)【IIS 6.0 ASP.NET应用程序仅仅支持HTTP】
    • Windows Process Activation Service (WAS) i.e. IIS 7.0 supports HTTP, TCP,【窗体进程激活服务(WAS),例如IIS 7.0 支持 HTTP,TCP,NamedPipes, MSMQ】
      NamedPipes, MSMQ.

Next WCF Tutorial on Interview Questions and Answers in this series is about Proxy and Channel Factory, Concurrency and Throttling in WCF.

下一篇WCF系列教程中,将会说道代理,渠道工厂,WCF的并发性和节流。

 

转载于:https://www.cnblogs.com/caofangsheng/p/5492287.html

a0103122120
关注 关注
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
分享WCF文件传输实现方法---WCFFileTransfer
09-03
WCF是微软提供的一个框架,用于构建面向服务的应用程序。它是.NET Framework的一部分,其主要目的是简化分布式应用程序的创建过程。 描述中提到了WCF文件传输的实现方法,强调了需要的朋友可以参考该方法。它暗示了...
WCF学习系列二---【WCF Interview Questions – Part 2 翻译系列
a0103122120的博客
05-14 123
http://www.topwcftutorials.net/2012/09/wcf-faqs-part2.html WCF Interview Questions – Part 2 This WCF tutorial is part-2 in series of WCF Interview Questions. Otherparts in this series ca...
WCF学习系列三--【WCF Interview Questions – Part 3 翻译系列
a0103122120的博客
05-20 140
http://www.topwcftutorials.net/2012/10/wcf-faqs-part3.html WCF Interview Questions – Part 3 This WCF tutorial is part-3 in series of WCF Interview Questions and Answers. Otherparts in this...
WCF学习系列四--【WCF Interview Questions – Part 4 翻译系列
a0103122120的博客
05-20 114
WCF Interview Questions – Part 4 This WCF service tutorial is part-4 in series of WCF Interview Questions. Before reading this please go through the following articles in this series. ...
WCF学习系列汇总
a0103122120的博客
05-20 119
最近在学习WCF,打算把一整个系列的文章都”写“出来,包括理论和实践,这里的“写”是翻译,是国外的大牛写好的,我只是搬运工外加翻译翻译的不好,大家请指正,谢谢了。如果觉得不错的话,也可以给我点赞,这样我翻译下去的动力就更足了~~~ 1.Beginning WCF - MUST HAVE WCF Basics - FAQs Series【WCF基础----...
WCF Basics - FAQs Series【WCF基础----问答系列教程】
a0103122120的博客
05-20 117
WCF学习系列一【WCF Interview Questions-Part 1 翻译系列WCF学习系列二---【WCF Interview Questions – Part 2 翻译系列WCF学习系列三--【WCF Interview Questions – Part 3 翻译系列WCF学习系列四--【WCF Interview Questions – Part 4 翻...
WCF教程-讲的很详细
hotmocha的专栏
07-09 887
WCF Tutorial is a comprehensive resource for Microsoft Windows Communication Foundation. Learn Windows Communication Foundation with the help of plenty of tutorials, tips, FAQs and code examples. Also
MVC interview questions with answers
slamzwl的专栏
03-26 1083
MVC interview questions with answers By Shivprasad koirala, 26 Mar 2014    4.87 (178 votes)   Rate: vote 1vote
.NET Interview Questions
weixin_30599769的博客
08-13 520
.NET Interview Questions 4 th Edition By Shivprasad Koirala (Around 600 plus Interview questions from real .NET Interviews) Do not forget to visit http://www.questpond.com for more new interview...
Practical guide to WCF RESTful service
weixin_34384557的博客
10-26 102
2019独角兽企业重金招聘Python工程师标准>>> ...
安装nginx实现多ip访问多网站
最新发布
wisdom_serein的博客
10-21 101
4,自定义nginx配置文件通过多个ip地址区分多网站。3,在主机的网卡添加多个ip地址(nmtui)1,关闭防火墙,selinux。2,挂载,安装nginx。
通信基站类型、频段与网络标准
weixin_42736657的博客
10-18 605
随着技术的发展,新的网络标准不断推出,基站的技术也在不断升级,以适应更高的数据传输需求和服务质量要求。未来,我们可能会看到更多创新的标准和技术,进一步推动移动通信的发展。
Linux网络:UDP socket - 简单聊天室
盒马的博客
10-21 405
使用Linux系统调用,实现一个简单的聊天室
前端开发攻略---8种方法实现在浏览器中跨页面通信
nibabaoo的博客
10-15 1343
浏览器实现跨标签页通信的多种方式
ARP欺骗
cyy001128的博客
10-16 964
ARP 欺骗(ARP spoofing)是一种网络攻击技术,通过发送伪造好的 ARP 数据包,伪装成网关使被攻击者误以为攻击者是其网关或其它设备,从而达到欺骗目标设备的目的。这样,攻击者就可以截获查看被攻击者发出的数据包,甚至可以修改、篡改数据包中的内容。arp欺骗最主要的目的是截获数据ARP欺骗攻击能导致网络连通性问题。注:网关并不是指具体的设备,路由器,计算机终端等各种各样的设备都可以是⽹关,⽹关就是数据必须经过的关⼝。
【信息安全管理与评估】2023年全国职业院校技能大赛赛题第04套
Play_Sai的博客
10-15 1201
取证的信息可能隐藏在正常的、已删除的或受损的文件中,您可能需要运用编码转换技术、加解密技术、隐写技术、数据恢复技术,还需要熟悉常用的文件格式(如办公文档、压缩文档、图片等)。A 集团的 Ubuntu 服务器被黑客入侵,该服务器的 Web 应用系统被上传恶意软件,系统文件被恶意软件破坏,您的团队需要帮助该公司追踪此网络攻击的来源,在服务器上进行全面的检查,包括日志信息、进程信息、系统文件、恶意文件等,从而分析黑客的攻击行为,发现系统中的漏洞,并对发现的漏洞进行修复。这种攻击叫做( )。
WCF系列:理解WCF寻址基础与编程模型
WCF专题系列的第一部分中,深入探讨了WCF服务的寻址机制。WCF服务的核心是其终结点,每个终结点由地址(Address)、绑定(Binding)和契约(Contract)三要素构成,它们分别定义了服务的位置、通信方式和提供的...
写文章

热门文章

  • C#中方法的调用 4146
  • SQL--使用NewID函数,创建GUID列 1088
  • C#--静态成员的生命周期 1063
  • MVC中在一个视图中,怎么加载另外一个视图? 1046
  • SQL---一次插入多条数据【使用Union】 1021

大家在看

  • 山体滑坡监测预警系统 Opencv
  • 小区消防通道堵塞监测识别方案 YOLOX 216
  • 推荐一款功能强大的智能语言交互软件:豆包桌面客户端
  • Java复习10(PTA) 24
  • JAVA基础笔记3(选择结构+循环结构) 300

最新文章

  • 21.翻译系列:Entity Framework 6 Power Tools【EF 6 Code-First系列】
  • 20.2.翻译系列:EF 6中基于代码的数据库迁移技术【EF 6 Code-First系列】
  • 20.1翻译系列:EF 6中自动数据迁移技术【EF 6 Code-First系列】
2019年53篇
2016年74篇
2015年104篇

目录

目录

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值

玻璃钢生产厂家溧水商场节庆美陈甘南仿真玻璃钢雕塑安装信阳房地产玻璃钢仿铜雕塑环保玻璃钢雕塑优势肇庆玻璃钢卡通雕塑制作珠海卡通玻璃钢雕塑定制工业齿轮玻璃钢景观雕塑灰太狼玻璃钢雕塑吉林多彩玻璃钢雕塑销售电话肇庆玻璃钢动物雕塑山东玻璃钢雕塑厂家直销无锡定做玻璃钢座椅雕塑青浦区玻璃钢雕塑推荐安徽玻璃钢雕塑人物海马玻璃钢雕塑山东户外玻璃钢雕塑批发商场美陈制造工厂陈村校园玻璃钢人物雕塑玻璃钢铜锈雕塑山东玻璃钢人物雕塑价格武都玻璃钢雕塑安装上海玻璃钢雕塑油漆工招聘新密景观玻璃钢仿铜雕塑苏州玻璃钢广场雕塑扬州商场大型美陈河南商场美陈批发价台湾仿铜西式玻璃钢雕塑嘉馨玻璃钢雕塑公司树脂玻璃钢人物雕塑合肥玻璃钢雕塑厂香港通过《维护国家安全条例》两大学生合买彩票中奖一人不认账让美丽中国“从细节出发”19岁小伙救下5人后溺亡 多方发声单亲妈妈陷入热恋 14岁儿子报警汪小菲曝离婚始末遭遇山火的松茸之乡雅江山火三名扑火人员牺牲系谣言何赛飞追着代拍打萧美琴窜访捷克 外交部回应卫健委通报少年有偿捐血浆16次猝死手机成瘾是影响睡眠质量重要因素高校汽车撞人致3死16伤 司机系学生315晚会后胖东来又人满为患了小米汽车超级工厂正式揭幕中国拥有亿元资产的家庭达13.3万户周杰伦一审败诉网易男孩8年未见母亲被告知被遗忘许家印被限制高消费饲养员用铁锨驱打大熊猫被辞退男子被猫抓伤后确诊“猫抓病”特朗普无法缴纳4.54亿美元罚金倪萍分享减重40斤方法联合利华开始重组张家界的山上“长”满了韩国人?张立群任西安交通大学校长杨倩无缘巴黎奥运“重生之我在北大当嫡校长”黑马情侣提车了专访95后高颜值猪保姆考生莫言也上北大硕士复试名单了网友洛杉矶偶遇贾玲专家建议不必谈骨泥色变沉迷短剧的人就像掉进了杀猪盘奥巴马现身唐宁街 黑色着装引猜测七年后宇文玥被薅头发捞上岸事业单位女子向同事水杯投不明物质凯特王妃现身!外出购物视频曝光河南驻马店通报西平中学跳楼事件王树国卸任西安交大校长 师生送别恒大被罚41.75亿到底怎么缴男子被流浪猫绊倒 投喂者赔24万房客欠租失踪 房东直发愁西双版纳热带植物园回应蜉蝣大爆发钱人豪晒法院裁定实锤抄袭外国人感慨凌晨的中国很安全胖东来员工每周单休无小长假白宫:哈马斯三号人物被杀测试车高速逃费 小米:已补缴老人退休金被冒领16年 金额超20万

玻璃钢生产厂家 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化