WCF return remote server 404 not found: There was no endpoint listening at http://localhost:52047/RxDBService.svc that could accept the message. This is often caused by an incorrect address or SOAP action

Kate He 1 Reputation point
2021-09-23T21:00:05.427+00:00

Hi, I've encountered this issue and couldn't figure out what's wrong. Please help!
I have this application calls services from the main project.

Errors:
"There was no endpoint listening at http://localhost:52047/RxDBService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."}
InnerException {"The remote server returned an error: (404) Not Found."}

I suspect I need to add an endpoint in the Service web.config?

Below is my code, kindly help what I'm missing here. Thanks.

Web.cnfig in WCF Services

<?xml version="1.0"?>
<configuration>


  <system.serviceModel>
    <behaviors> 
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>

          <serviceDebug includeExceptionDetailInFaults="false"/>

          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <protocolMapping>
        <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>
    <bindings>
      <webHttpBinding>
        <binding name="webHttpBindingDev" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"  maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"  maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
        </binding>
      </webHttpBinding>
    </bindings>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />



  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="true"/>
  </system.webServer>

</configuration>

Web config on main application

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IRxDBService" />
        <binding name="BasicHttpBinding_IService1" />
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:52047/RxDBService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRxDBService" contract="RxDBService.IRxDBService" name="BasicHttpBinding_IRxDBService" />
      <endpoint address="http://localhost:52047/RxDataService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1" contract="RxDataService.IService1" name="BasicHttpBinding_IService1" />
    </client>
  </system.serviceModel>
Developer technologies | .NET | .NET Runtime
Developer technologies | .NET | Other
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.