WCF Exception Contract Missmatch,我不这么认为

时间:2013-03-04 14:32:27

标签: wcf service iis-8

  

服务器没有提供可能由此引起的有意义的回复   合同错误,过早的会话关闭或内部服务器   错误

嘿,我在调用wcf服务后遇到异常。我知道这个异常可以在stackoverflow上找到很多,但我有一个特殊的行为。我也尝试了几乎所有推荐的解决方案,但没有成功......

我的项目执行以下操作:模块类似于正常聊天,wpf和asp usercontrol每5秒调用一次服务并获取在线用户。这通常在我的Windows 7工作站上正常工作。在我开始使用win 8在我的新工作站上开发软件之后,我得到了这个例外。 IIS配置仍然相同。在第一个用户开始频繁调用服务后,一切正常,直到第二个用户调用相同的服务,上面的异常显示出来。 我在win 7上设置了一个测试机,看看会发生什么......一切都有效......我不知道该怎么办......

服务web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics>
<sources>
  <source name="System.ServiceModel" switchName="Information, ActivityTracing"     propagateActivity="true">
    <listeners>
      <add name="xml" />
    </listeners>
  </source>
  <source name="System.ServiceModel.MessageLogging">
    <listeners>
      <add name="xml" />
    </listeners>
  </source>
  <source name="myUserTraceSource" switchName="Information, ActivityTracing">
    <listeners>
      <add name="xml" />
    </listeners>
  </source>
</sources>
<sharedListeners>
  <add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="hi5.PSA.ServiceLog.svclog" />
</sharedListeners>
</system.diagnostics>
<appSettings>
<add key="Log4NetPath" value="config.log4net" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0">
  <assemblies>
    <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  </assemblies>
</compilation>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
<!-- that many MB should be enough :) -->
<httpRuntime maxRequestLength="2147483647" />
</system.web>
<system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_IPmiLookup" />
  </basicHttpBinding>
</bindings>
<services>
  <service name="SolutionName.ChatService" behaviorConfiguration="chatServiceBehavior">
    <endpoint address="" binding="wsDualHttpBinding" contract="SolutionName.contracts.Chat.IChatManager" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<behaviors>
  <serviceBehaviors>        
    <behavior name="chatServiceBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
  <modules runAllManagedModulesForAllRequests="true"></modules>
 </system.webServer>
<connectionStrings>
<add name="MyEntities" connectionString="metadata=res://*/Users.csdl|res://*/Users.ssdl|res://*/Users.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=localhost;Initial Catalog=MyDB;Integrated Security=SSPI;MultipleActiveResultSets=True&quot;&#xD;&#xA;" providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>

客户端app.config:

<system.serviceModel>
<bindings>
  <wsDualHttpBinding>
    <binding name="WSDualHttpBinding_IChatManager" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <reliableSession ordered="true" inactivityTimeout="00:10:00" />
      <security mode="Message">
        <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
      </security>
    </binding>
  </wsDualHttpBinding>
</bindings>
<client>
  <endpoint address="http://localhost/SolutionName/ChatService.svc" binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IChatManager" contract="hi5.medview.server.contracts.Chat.IChatManager" name="WSDualHttpBinding_ChatManager">
    <identity>
      <servicePrincipalName value="host/MyName"/>
    </identity>
  </endpoint>
</client>

有没有人有任何想法。令我疯狂的是,该服务适用于第一个正在调用它的用户,但在第二个用户调用它之后,该死的东西不再起作用了...... 请帮忙... THX

0 个答案:

没有答案