none
"There was no endpoint listening..." error

    Question

  • Hi to all WCF developers!

     

    Here is a question, I received this error "There was no endpoint listening..." today trying to test my first WCF service hosted on a Console App. I'm going through a Microsoft Lab (The fundamentals of Programming the WCF) and other than the code provided in there, I just changed minor stuff because the source was pre Orcas February CTP and some stuff changed after that (I'm running March CTP).

     

    I know this message usually refers to missconfiguration either in the client or the host configuration files but I can't find what is wrong. I managed to run svcutil.exe to create a proxy with no inconviniences and if I know my service is available because I can hit the HTTP base address (http://localhost:8000/Derivatives/) and also the wsdl metadata (http://localhost:8000/Derivatives/Calculator?wsdl)

     

    Is there any WCF savvy developer who wants to help a WCF newbie out there?

     

    Thanks!

    Thursday, June 07, 2007 3:58 PM

Answers

  • A quick update for anyone interested in knowing how I fix this problem.

     

    The issue was solved after a few tweaks in the app.config running on the host project. That is, the project instantiating the ServiceHost class

     

    instead of

    <add key="HTTPBaseAddress" value="http://localhost:8000/Derivatives/"/>

     

    I typed this

    <add key="HTTPBaseAddress" value="http://localhost:8000/Derivatives/Calculator"/>

     

    (the bold is there to indicate the changes introduced)

    Monday, June 11, 2007 5:31 PM

All replies

  • Can you post the entire error message?  If you want to just make a quick ad-hoc client to hit that service endpoint, you can do something like this:

     

    ChannelFactory<YourServiceContract> factory = new ChannelFactory<...>(BindingUsedForService, ServiceEndpointAddress);

    YourServiceContract channel = factory.CreateChannel();

     

    channel.MethodDefinedOnContract(parameters);

     

    -James

    Thursday, June 07, 2007 8:09 PM
  • Thanks James...

     

    Here is some more information about the error message:

     

    "There was no endpoint listening at http://localhost:8000/Derivatives/Calculator that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."

     

    This is the app.config on the WCF service project (created by direct typing, but I believe it has no errors, otherwise the service won't be available when I access it with Internet Explorer right?)

     

    <?xml version="1.0" encoding="utf-8" ?>

    <configuration>

    <appSettings>

    <add key="HTTPBaseAddress" value="http://localhost:8000/Derivatives/"/>

    <add key="TCPBaseAddress" value="net.tcp://localhost:8010/Derivatives/"/>

    </appSettings>

    <system.serviceModel>

    <services>

    <service name="DerivativesCalculator.DerivativeCalculatorServiceType" behaviorConfiguration="metadataSupport">

    <endpoint address="Calculator"

    binding="basicHttpBinding"

    contract="DerivativesCalculator.IDerivativesCalculator" />

    <endpoint address="Calculator/mex"

    binding="mexHttpBinding"

    contract="IMetadataExchange"/>

    </service>

    </services>

    <behaviors>

    <serviceBehaviors>

    <behavior name="metadataSupport">

    <!-- Enables the IMetadataExchange endpoint in services that -->

    <!-- use "metadataSupport" in their behaviorConfiguration attribute. -->

    <!-- In addition, the httpGetEnabled and httpGetUrl attributes publish -->

    <!-- Service metadata for retrieval by HTTP/GET at the address -->

    <!-- "http://localhost:8080/SampleService?wsdl" -->

    <serviceMetadata httpGetEnabled="true" httpGetUrl="Calculator"/>

    </behavior>

    </serviceBehaviors>

    </behaviors>

    </system.serviceModel>

    </configuration>

     

    And here is the app.config on the WCF client project (created by using the svcutil tool)

    <?xml version="1.0" encoding="utf-8"?>

    <configuration>

    <system.serviceModel>

    <bindings>

    <basicHttpBinding>

    <binding name="BasicHttpBinding_IDerivativesCalculator" closeTimeout="00:01:00"

    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"

    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"

    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"

    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"

    useDefaultWebProxy="true">

    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"

    maxBytesPerRead="4096" maxNameTableCharCount="16384" />

    <security mode="None">

    <transport clientCredentialType="None" proxyCredentialType="None"

    realm="" />

    <message clientCredentialType="UserName" algorithmSuite="Default" />

    </security>

    </binding>

    </basicHttpBinding>

    </bindings>

    <client>

    <endpoint address="http://localhost:8000/Derivatives/Calculator"

    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IDerivativesCalculator"

    contract="IDerivativesCalculator" name="BasicHttpBinding_IDerivativesCalculator" />

    </client>

    </system.serviceModel>

    </configuration>

     

    Hope this additional info helps to narrow down the cause of the problem.

     

    I'll try to use a Factory, but my intention is not to "make it work" (as it is not production code or a piece of software for a customer) but to understand how it works... so I'm leaning more thowards the possibility to make it work using a proxy rather than "using a different approach".

    Friday, June 08, 2007 1:01 PM
  • A quick update for anyone interested in knowing how I fix this problem.

     

    The issue was solved after a few tweaks in the app.config running on the host project. That is, the project instantiating the ServiceHost class

     

    instead of

    <add key="HTTPBaseAddress" value="http://localhost:8000/Derivatives/"/>

     

    I typed this

    <add key="HTTPBaseAddress" value="http://localhost:8000/Derivatives/Calculator"/>

     

    (the bold is there to indicate the changes introduced)

    Monday, June 11, 2007 5:31 PM
  • Likewise, you could change the endpoint address in the Client's config to point to http://localhost:8000/Derivatives, but I think less general endpoint addresses are better.  Sorry I missed this one, but I'm glad you found what needed fixing!

     

    -James

    Monday, June 11, 2007 6:13 PM
  • Pls double check the endpoint address between client and service
    Saturday, January 30, 2010 12:06 PM
  • Dude,the solution is very simple

    Make sure that the service should be  in a different solution  and client in another solution

    Also make sure that service should be running while we debug the client

    Thursday, March 29, 2012 12:53 PM