There was no channel actively listening at wcf

Chandra picture Chandra · Feb 10, 2014 · Viewed 8k times · Source

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.

Answer

Tewr picture Tewr · Feb 10, 2014

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