2014-02-22 131 views
-1

我试过所有的东西,毕竟我在error.svclog文件中发现客户端能够打到服务但服务抛出EndPointNotFoundException。 我也看到服务器日志来检查状态,它显示在下面。EndPointNotFoundException服务抛出错误

#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 

我服务的web.config文件

<?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> 

我的客户app.congif文件

<?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> 
+0

显示您的Web.Config文件。 –

回答

0

WCF被设计为在默认情况下的安全。而且这种安全意味着不仅服务器需要知道谁在调用它,而且客户端需要确定它正在与之交谈的服务器确实是它正在考虑的服务器。

用于此检查的是服务标识。为了使客户端信任服务器,该服务器的身份需要与客户端的身份定义相匹配。

在你的configs服务定义的身份如下:

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

和客户端如下:

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

那些身份不匹配,因此客户端没有说话的正确的端点==>端点未找到异常。

解决方案: 如果不需要安全检查,请将身份匹配或完全删除身份。

+0

我已经改变了你所提到的关于身份的事情,@Marc Selis。但是,我没有得到任何改善。你能提出更多建议吗? – Akashkumar

相关问题