1

サーバーは意味のある応答を提供しませんでした。これは、コントラクトのミスマス、時期尚早のセッション シャットダウン、または内部サーバー エラーが原因である可能性があります。

wcf サービスを呼び出した後、例外が発生しました。この例外がスタックオーバーフローでよく見つかることは知っていますが、私には特別な振る舞いがあります。また、推奨されるほぼすべてのソリューションを試しましたが、成功しませんでした...

私のプロジェクトは次のことを行います: モジュールは通常のチャットのようなもので、wpf と asp のユーザー コントロールが 5 秒ごとにサービスを呼び出し、オンライン ユーザーを取得します。これは通常、Windows 7 ワークステーションで正常に機能しました。win 8 を搭載した新しいワークステーションでソフトウェアの開発を開始した後、この例外が発生しました。IIS 構成は同じままです。最初のユーザーがサービスを頻繁に呼び出すようになった後、2 番目のユーザーが同じサービスを呼び出すまで、上記の例外が表示されます。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>

誰でも何か考えがありますか。私を夢中にさせるのは、サービスを呼び出している最初のユーザーに対してはサービスが正常に機能することですが、2番目のユーザーが呼び出した後、いまいましいことはもう機能しません...助けてください... Thx

4

0 に答える 0