Consuming WCF Error: There was no endpoint listening at that could accept the message

on Dec 08, 2019 11:50 PM


I can able to add service reference of SOAP service, able to see what type of parameters and how many parameters all their methods expects.  But when I run the application, I am getting below exception.

There was no endpoint listening at that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

inner exception: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

I am sure it is not connection or IP address or firewall issue, because using SOAP UI tool, I am getting the response as expected from this same machine. Below is my code.

Kindly help what I am missing here.

using Consume_REDF_FourTimesAuth.ServiceReference1;
    FinanceClient objFinanceClient = new FinanceClient("WSHttpBinding_IFinance");
    System.Net.ServicePointManager.ServerCertificateValidationCallback = ((se, certificate, chain, sslPolicyErrors) => true);
    objFinanceClient.ClientCredentials.UserName.UserName = "abc";
    objFinanceClient.ClientCredentials.UserName.Password = "13456";
    Credential objCredentials = new Credential();
    objCredentials.UserName = "xyz";
    objCredentials.Password = "123456";

    var Response = objFinanceClient.getRealEstateRegions(objCredentials);
    //var Response = objFinanceClient.getCalculaterV2(objCredentials, 123456, 22.2, 11.1, 12, 202, 24, 06, "10/06/1987", 
    //                                                2, "02/11/2019", 22.2, 2, 2, 22.2, 2, 22.2);
    lblDisplay.Text = Response.ToString();
catch (Exception ex)
    throw ex;

Entries made automatically in web.config after adding service reference.

        <binding name="WSHttpBinding_IFinance">
          <security mode="Transport">
            <transport clientCredentialType="Basic" />
      <endpoint address=""
        binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IFinance"
        contract="ServiceReference1.IFinance" name="WSHttpBinding_IFinance">
          <dns value="" />


Download FREE API for Word, Excel and PDF in ASP.Net: Download
on Dec 11, 2019 07:51 AM
on Dec 11, 2019 07:59 AM