WCF相关
?WCF是.net框架中的一个部分,是面向服务编程的一种技术方式,和以往的webservice技术不同的是,它是microsoft希望的集大成者,希望也确实是综合了以往的webservice技术。 ? WCF的服务是.svc为后缀的文件,宿主既可以是IIS,控制台程序,也还有各种各种多样的。开发的时候一般是用控制台程序控制和开发. ? 寄宿在IIS7上的WCF服务,暴露在endpoint下的是有一个.svc服务,一个web.config配置文件 ? IIS全过程: client------proxy class------(endpoint)------host(web.config+.svc)------service ? WCF拥有两种配置服务的方法: 在代码段中设置 和 在配置文件中设置 这些在MSDN上都有具体的说明 ? 配置文件: 有endpoint+binding+serviceBehavior endpoint:service暴露给client端得就叫endpoint binding:client和service的连接通道的规则就叫binding ?????????????? 其中包含很多种binding,大概有20几种,有的按照传输方式分:HTTPbinding,TCPBinding,有的按照安全性分:WS2007Binding等等,还有一种是最常用的:customerBinding,就是客户自定义的binding serviceBehavior:服务执行前所自动做的操作 ? 在HTTPS的传输协议上,有一种securityToken的传输方式: 这种传输方式是一种比较复杂的方式,简而言之,client端先向STS请求Token,然后使用Token和Service进行通信 The previous diagram shows a claims-aware Web service (the relying party application) and a smart client that wants to use that service. The RP exposes a policy that describes its addresses,bindings,and contracts. But the policy also includes a list of claims that the RP needs,such as user name,e-mail address,and role memberships. The policy also tells the smart client the address of the STS from which it should retrieve these claims. After retrieving this policy (1),the client now knows where to go to authenticate: the STS. The user presents credentials (2) and the smart client makes a web service request (3) to the STS,requesting the claims that the RP asked for in its policy. The job of the STS is to authenticate the user and return a security token that gives the RP all of the claims it needs. The smart client then makes its request to the relying party (4),sending the security token along in the security SOAP header. The RP now receives claims with each request,and simply rejects any requests that don’t include a security token from the issuing authority that it trusts. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |