There was no channel actively listening at wcf

8.5k views Asked by At

I have been working on a WCF service which is developed in VS 2008 and hosted in Windows Server 2008, IIS 7.0, When I host this service in my local environment, its working fine but when i host this service in production site its not working. In this service i am using WShttpbinding binding, and i am using the Security mode is message and clientcredential type is "Username"

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

In behaviour configuration i am using the

 <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>

but when i consume the service from my client application it gives me the error

There was no channel actively listening at "//name of the machine where service hosted/servicename/$metadata" This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service is listening.

2

There are 2 answers

0
Tamilselvan K On
<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>
1
Tewr On

Looks like your problem is with the metadata, according to the error message.

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

Try removing the // in the beginning of httpsGetUrl attribute, they might be causing you trouble.

Here are a few examples of configurations: http://msdn.microsoft.com/en-us/library/ms731317(v=vs.110).aspx