Question

I had tried all the things, after all that I found out in error.svclog file that client able to hit the service but service throwing EndPointNotFoundException. I had also seen the server log to check the status and it is display below.

#Software: Microsoft Internet Information Services 7.5
#Version: 1.0
#Date: 2014-02-22 09:22:35
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
2014-02-22 09:22:35 192.168.10.9 GET /HostWCF/Service.svc - 80 - 192.168.10.10 Mozilla/5.0+(Windows+NT+6.2;+WOW64;+rv:27.0)+Gecko/20100101+Firefox/27.0 200 0 0 60360
2014-02-22 09:22:54 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 52
2014-02-22 09:23:04 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 52
2014-02-22 09:30:24 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 1994
2014-02-22 09:30:34 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 73
2014-02-22 09:30:44 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 52
2014-02-22 09:30:54 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 54
2014-02-22 09:31:04 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 69
2014-02-22 09:31:14 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 67
2014-02-22 09:31:24 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 62
2014-02-22 09:31:34 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 67
2014-02-22 09:31:44 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 50
2014-02-22 09:31:54 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 59
2014-02-22 09:32:04 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 50
2014-02-22 09:32:14 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 54
2014-02-22 09:32:24 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 51
2014-02-22 09:32:34 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 53
2014-02-22 09:32:44 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 82
2014-02-22 09:32:54 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 79
2014-02-22 09:33:04 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 60
2014-02-22 09:33:14 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 52
2014-02-22 09:33:24 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 76
2014-02-22 09:33:34 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 49
2014-02-22 09:33:44 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 52
2014-02-22 09:33:54 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 57
2014-02-22 09:34:04 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 72
2014-02-22 09:34:14 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 51
2014-02-22 09:34:24 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 60
2014-02-22 09:34:34 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 62
2014-02-22 09:34:44 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 55
2014-02-22 09:34:54 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 95
2014-02-22 09:35:04 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 55
2014-02-22 09:35:14 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 54
2014-02-22 09:35:24 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 58
2014-02-22 09:35:34 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 57
2014-02-22 09:35:44 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 53
2014-02-22 09:35:54 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 67
2014-02-22 09:36:04 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 54
2014-02-22 09:36:14 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 60
2014-02-22 09:36:24 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 65
2014-02-22 09:36:34 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 59
2014-02-22 09:36:44 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 58
2014-02-22 09:36:54 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 56
2014-02-22 09:37:04 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 51
2014-02-22 09:37:14 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 70
2014-02-22 09:37:24 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 61
2014-02-22 09:37:34 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 61
2014-02-22 09:37:44 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 65
2014-02-22 09:37:54 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 56
2014-02-22 09:38:04 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 69
2014-02-22 09:38:14 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 55
2014-02-22 09:38:24 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 51
2014-02-22 09:38:34 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 54
2014-02-22 09:38:44 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 51
2014-02-22 09:38:54 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 57
2014-02-22 09:39:04 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 62
2014-02-22 09:39:14 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 55
2014-02-22 09:39:24 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 56
2014-02-22 09:39:34 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 55
2014-02-22 09:39:44 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 56
2014-02-22 09:39:54 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 56
2014-02-22 09:40:04 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 56
2014-02-22 09:40:14 192.168.10.9 POST /hostwcf/service.svc - 80 - 192.168.10.10 - 202 0 0 67

my service web.config file

<?xml version="1.0"?>
 <configuration>
<configSections>
</configSections>
<system.diagnostics>
<sources>
  <source name="System.ServiceModel"
          switchValue="Information, ActivityTracing"
          propagateActivity="true" >
    <listeners>
      <add name="xml"/>
    </listeners>
  </source>
  <source name="System.ServiceModel.MessageLogging">
    <listeners>
      <add name="xml"/>
    </listeners>
  </source>
  <source name="myUserTraceSource"
          switchValue="Information, ActivityTracing">
    <listeners>
      <add name="xml"/>
    </listeners>
  </source>
</sources>
<sharedListeners>
  <add name="xml"
       type="System.Diagnostics.XmlWriterTraceListener"
       initializeData="Error.svclog" />
  </sharedListeners>
</system.diagnostics>
<connectionStrings>
  <add name="Connection" connectionString="Server=.\SQLSERVER;  Database=databaseDB;Trusted_Connection=True;"/>

</connectionStrings>
 <system.web>
  <!--<webServices>
  <protocols>
    <add name ="HttpGet"/>
    <add name="HttpPost"/>
    <add name="HttpPostLocalhost"/>
    <add name="HttpSoap"/>

  </protocols>
  </webServices>-->
  <compilation debug="true" targetFramework="4.0" />
 </system.web>
 <system.webServer>
  <!--<defaultDocument>
  <files>
    <add value="Service.svc"/>
  </files>
  </defaultDocument>-->
  </system.webServer>
  <system.serviceModel>
  <bindings>
  <wsDualHttpBinding>
    <binding name="DualNewBinding"> 
      <!--receiveTimeout="01:10:00" sendTimeout="01:10:00"  closeTimeout="02:00:00" openTimeout ="01:40:00" useDefaultWebProxy ="True" >-->
      <security mode="None">
        <message clientCredentialType ="None"/>
      </security>
    </binding>
  </wsDualHttpBinding>
  </bindings>
  <services>
  <service 
    behaviorConfiguration="HostWCF.ServiceBehavior" name="HostWCF.Service" >
    <endpoint address="" binding="wsDualHttpBinding" bindingConfiguration="DualNewBinding" contract="HostWCF.IService">
      <identity>
        <dns value="localhost"/>
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost/HostWCF"/>
      </baseAddresses>
    </host>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="HostWCF.ServiceBehavior">
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="true" />
      <serviceCredentials >
        <windowsAuthentication allowAnonymousLogons ="true"/>
      </serviceCredentials>
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
  <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

</configuration>

my client app.congif file

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
 <add name="connection" connectionString="Server=.\SQLEXPRESS;Database=TISDB;Trusted_Connection=True;"/>
 </connectionStrings>
  <system.serviceModel>
    <bindings>
        <wsDualHttpBinding>
          <binding name="WSDualHttpBinding_IService"  openTimeout="00:10:00" closeTimeout ="00:20:00" bypassProxyOnLocal ="false" receiveTimeout ="00:08:00" sendTimeout ="00:10:00" useDefaultWebProxy ="true">
            <security mode="None">
              <message clientCredentialType ="None"/>
            </security>
          </binding>
        </wsDualHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://192.168.10.9/hostwcf/service.svc" binding="wsDualHttpBinding"
            bindingConfiguration="WSDualHttpBinding_IService" contract="ServiceReference.IService"
            name="WSDualHttpBinding_IService">
            <identity>
                <dns value="192.168.10.9" />
            </identity>
        </endpoint>
    </client>
   </system.serviceModel>
 </configuration>

No correct solution

OTHER TIPS

WCF was designed to be secure by default. And that security implies that not only the server needs to know who is calling it, but also that the client needs to be sure that the server it is talking to is indeed the server it is excpecting to be.

The thing that is used for this check is the service identity. For a client to trust the server, the identity of that server needs to match the identity definition of the client.

In your configs the service defines the identity as follows:

  <identity>
    <dns value="localhost"/>
  </identity>

and the client as follows:

    <identity>
        <dns value="192.168.10.9" />
    </identity>

Those identities don't match and thus the client is not talking to the correct endpoint ==> endpoint not found exception.

Solution: Make the identities match, or remove the identities altogether if that security check is not required.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top