经常搞wcf的基友们肯定会知道,当你的应用程序有很多的“服务引用”的时候,是不是有一种疯狂的感觉。。。从一个环境迁移到另外一个环境,你需要改变的endpoint会超级tmd的多,简直就是搞死了人。。。好了,这篇我们来看看如何最小化配置。 ...
经常搞get='_blank'>wcf的基友们肯定会知道,当你的应用程序有很多的“服务引用”的时候,是不是有一种疯狂的感觉。。。从一个环境迁移到另外一个环境,你需要改变的
endpoint会超级tmd的多,简直就是搞死了人。。。好了,这篇我们来看看如何最小化配置。
一:精简service的config配置
就像上一篇的代码一样,我的service端的config配置如下:
1 <??> 2 <configuration> 3 <system.servicemodel> 4 <behaviors> 5 <servicebehaviors> 6 <behavior name="mxbehavior"> 7 <servicemetadata httpgetenabled="true" /> 8 <servicedebug includeexceptiondetailinfaults="true" /> 9 </behavior>10 </servicebehaviors>11 </behaviors>12 <services>13 <service name="myservice.homeservice" behaviorconfiguration="mxbehavior">14 <endpoint address="net.tcp://localhost:1920/homeservice" binding="nettcpbinding" contract="myservice.ihomeservice">15 <identity>16 <dns value="localhost" />17 </identity>18 </endpoint>19 <endpoint address="mex" binding="mexhttpbinding" contract="imetadataexchange" />20 <host>21 <baseaddresses>22 <add baseaddress="http://localhost:19200/homeservice"/>23 </baseaddresses>24 </host>25 </service>26 </services>27 </system.servicemodel>28 </configuration>
原标题:十五天精通WCF——第二天 告别烦恼的config配置
关键词:wcf
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。