两个基本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配置

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

 

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

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

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

 

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

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

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

2010-02-25 09:50:30

WCF路由截获消息

2010-02-25 10:52:29

WCF响应服务

2010-02-26 13:40:28

WCF消息头

2010-02-25 18:04:02

WCF IIS宿主

2010-03-01 15:40:04

WCF实例停用

2010-03-01 16:04:31

WCF服务契约

2010-03-01 09:48:23

WCF会话服务

2010-03-01 11:24:31

WCF面向服务

2010-03-01 18:11:40

WCF数据契约变更

2010-02-24 12:49:39

WCF枚举

2009-12-21 10:27:52

WCF基本概念

2010-02-22 11:25:50

WCF DateSet

2010-02-22 16:19:25

WCF自托管

2010-02-22 16:26:47

WCF传输数据

2010-03-01 13:06:49

WCF继承

2009-08-11 15:44:05

C#基本技巧

2009-07-15 18:29:22

Jython应用

2011-09-20 15:19:15

Python

2010-11-22 15:48:40

MySQL修复表

2009-12-21 14:49:27

点赞
收藏

51CTO技术栈公众号