首页 > 其他 > 详细

WCF报错:带有协定的 ChannelDispatcher 无法打开其 IchannelListener

时间:2015-04-14 16:39:33      阅读:1345      评论:0      收藏:0      [点我收藏+]

在启动WCF服务时,报错:

“net.tcp://localhost:8080/tcpTest”处带有协定“"ITestService"”的 ChannelDispatcher 无法打开其 IchannelListener。

在查看详细异常信息时:找到InnerException异常信息中,发现:


{"未提供服务证书。请在 ServiceCredentials 中指定服务证书。"}


解决方法:


将:


 <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="TestBind" maxReceivedMessageSize="65536000">
          <readerQuotas maxDepth="32" maxStringContentLength="819200" maxArrayLength="16384" maxBytesPerRead="8192" maxNameTableCharCount="16384" />
          <reliableSession inactivityTimeout="00:05:00" />
          <security mode="Message">

<security mode="Message">改为:


<security mode="Transport">


原因:

如果mode改为message方式,这种方式是对消息加密或签名,因此必须要注定证书。



也可以指定证书位置:


<behaviors>
    <serviceBehaviors>
      <behavior name="CustomValidator">
        <serviceCredentials>
          <serviceCertificate 
            findValue="8e f9 c6 6f 4e a0 0c 49 4f 84 69 fb de c6 a7 e1 79 01 5b 6e"
            x509FindType="FindByThumbprint" 
            storeLocation="CurrentUser" 
            storeName="My" />
        </serviceCredentials>
      </behavior>
    </serviceBehaviors>
    </behaviors>


参考链接:

WCF Security of Windows and Certificate

WCF报错:带有协定的 ChannelDispatcher 无法打开其 IchannelListener

原文:http://blog.csdn.net/zhang116868/article/details/45043169

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!