两个基本WCF应用技巧总结

开发 开发工具
我们今天在这篇文章中为大家总结的两种常见的WCF应用技巧,都包括有生成证书的操作技巧,以及对config进行配置的技巧等。

在学习WCF开发工具的过程中,我们需要在不断的实践中去慢慢积累经验,来充实我们所掌握的应用技巧,这样才能应用于自如。在这里我们就为大家介绍两种常见的WCF应用技巧,方便大家掌握。#t#

WCF应用技巧1、生成证书

makecert -r -pe -n CN="MyWebServer" -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localmachine -sky exchange

-sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12

WCF应用技巧2、config配置

  1. < endpoint address ="" binding="wsHttpBinding" 
    contract="WcfService.IService1" 
    bindingConfiguration="EndpointBinding"> 

 

部署时,应删除或替换下列标识元素,以反映在其下运行部署服务的标识。删除之后,WCF 将自动推导相应标识。

  1. < identity> 
  2. < dns value="MyWebServer"/> 
  3. < /identity> 
  4. < /endpoint> 

  1. < bindings> 
  2. < wsHttpBinding> 
  3. < binding name="EndpointBinding"> 
  4. < security mode="Message"> 
  5. < transport clientCredentialType="Windows" 
    proxyCredentialType="Windows"/> 
  6. < message clientCredentialType="UserName"/> 
  7. < /security> 
  8. < /binding> 
  9. < /wsHttpBinding> 
  10. < /bindings> 

 

  1. < serviceCredentials> 
  2. < serviceCertificate findValue="MyWebServer" 
  3. x509FindType="FindBySubjectName" 
  4. storeLocation="LocalMachine" 
  5. storeName="My"/> 
  6. < userNameAuthentication userNamePasswordValidationMode="Custom"
     customUserNamePasswordValidatorType="WcfService.Models.
    CustomUserPassword,WcfService"
     /> 
  7. < /serviceCredentials> 

以上就是我们为大家总结的WCF应用技巧。

责任编辑:曹凯 来源: CSDN
相关推荐

2010-02-25 09:50:30

WCF路由截获消息

2010-03-01 15:40:04

WCF实例停用

2010-02-25 18:04:02

WCF IIS宿主

2010-03-01 09:48:23

WCF会话服务

2010-03-01 16:04:31

WCF服务契约

2010-02-25 10:52:29

WCF响应服务

2010-02-26 13:40:28

WCF消息头

2010-03-01 11:24:31

WCF面向服务

2010-03-01 18:11:40

WCF数据契约变更

2010-02-24 12:49:39

WCF枚举

2010-02-22 11:25:50

WCF DateSet

2009-12-21 10:27:52

WCF基本概念

2010-03-01 13:06:49

WCF继承

2010-02-22 16:26:47

WCF传输数据

2010-02-22 16:19:25

WCF自托管

2009-07-15 18:29:22

Jython应用

2010-11-22 15:48:40

MySQL修复表

2011-09-20 15:19:15

Python

2010-02-22 15:20:54

WCF WS-Disc

2010-02-22 17:21:02

WCF消息交换
点赞
收藏

51CTO技术栈公众号