【问题标题】:There was no channel actively listening at wcfwcf 上没有积极收听的频道
【发布时间】:2014-03-07 14:50:43
【问题描述】:

我一直致力于开发在 VS 2008 中开发并托管在 Windows Server 2008、IIS 7.0 中的 WCF 服务, 当我在本地环境中托管此服务时,它可以正常工作,但是当我在生产站点中托管此服务时,它无法正常工作。 在此服务中,我使用 WShttpbinding 绑定,并且我使用的安全模式是消息,客户端凭据类型是“用户名”

 <security mode= "Message">
    <message clientCredentialType="UserName" />
</security>

在行为配置中我使用的是

 <behavior name="name">
      <serviceMetadata  httpGetEnabled="true" httpsGetEnabled="true" httpsGetUrl="https://serviceurl/basic"/>                   
    <serviceDebug includeExceptionDetailInFaults="true" />
    <serviceCredentials>
    <serviceCertificate findValue="CN=WMSvc-AMAZONA-PJ1K606" />
    <userNameAuthentication userNamePasswordValidationMode="MembershipProvider" embershipProviderName="WCFSqlProvider" />
    </serviceCredentials>
    </behavior>

但是当我从我的客户端应用程序使用服务时,它给了我错误

在“//服务托管的机器名/servicename/$metadata”处没有主动监听的通道这通常是由不正确的地址 URI 引起的。确保 消息发送到的地址与服务正在侦听的地址匹配。

【问题讨论】:

    标签: wcf wcf-security wcf-wshttpbinding


    【解决方案1】:

    根据错误消息,您的问题似乎出在元数据上。

    <serviceMetadata  httpGetEnabled="true" httpsGetEnabled="true" httpsGetUrl="//https://serviceurl/basic"/>         
    

    尝试删除httpsGetUrl 属性开头的//,它们可能会给您带来麻烦。

    以下是一些配置示例:http://msdn.microsoft.com/en-us/library/ms731317(v=vs.110).aspx

    【讨论】:

    • 嘿..tewr 输入错误。
    【解决方案2】:
    <system.serviceModel>
        <bindings>
          <webHttpBinding>
            <binding name="TransportSecurity">
              <security mode="Transport">
                <transport clientCredentialType="None"/>
              </security>
            </binding>
          </webHttpBinding>
        </bindings>
        <services>
          <service name="Service" behaviorConfiguration="ServiceBehaviour">
            <endpoint address="" binding="webHttpBinding" behaviorConfiguration="webMyAcc" bindingConfiguration="TransportSecurity" contract="IService"/>
            <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="ServiceBehaviour">
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
          <endpointBehaviors>
            <behavior name="webMyAcc">
              <webHttp />
            </behavior>
          </endpointBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
        <client />
      </system.serviceModel>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-13
      • 2019-11-05
      • 2022-12-18
      • 1970-01-01
      • 2019-07-18
      相关资源
      最近更新 更多