2012-02-22 11 views
2

インスタンス化された.Netオブジェクトのコレクションを呼び出し元に渡すC#WCFサービスがあります。私はそれが次の例外で失敗したコレクションにあまりにも多くのオブジェクトを渡すようにしようとただした場合、正常に動作します:WCFサービスコールが失敗しました...私の設定ファイルで何が問題になっていますか?

{"An error occurred while receiving the HTTP response to http://myserver/MyAppService/MyAppService.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details."} 
{"The underlying connection was closed: An unexpected error occurred on a receive."} 
{"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."} 
{"An existing connection was forcibly closed by the remote host"} 

それは完全に再現可能だと間違いなく数のコレクション内のオブジェクトではなくオブジェクトの内容に関連しています。

もう1つの投稿に基づいて、クライアント側のapp.configファイルとサービスサーバー側のweb.configファイルの両方を変更しようとしました。しかし、変更によって問題が解決されなかったため、設定ファイルを正しく設定できなかった可能性があります。以下は

(非関連のものは削除)私のクライアント側のapp.configファイルです:

<system.serviceModel> 
    <bindings> 
    <basicHttpBinding> 
     <binding name="BasicHttpBinding_iMyAppService" closeTimeout="00:01:00" 
     openTimeout="00:01:00" receiveTimeout="01:00:00" sendTimeout="01:00:00" 
     allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
     maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" 
     messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 
     useDefaultWebProxy="true"> 
     <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" 
     maxBytesPerRead="4096" maxNameTableCharCount="2147483647" /> 
     <security mode="None"> 
      <transport clientCredentialType="None" proxyCredentialType="None" 
      realm="" /> 
      <message clientCredentialType="UserName" algorithmSuite="Default" /> 
     </security> 
     </binding> 
    </basicHttpBinding> 
    </bindings> 
    <behaviors> 
    <endpointBehaviors> 
     <behavior name="Behaviors.EndpointBehavior"> 
     <dataContractSerializer maxItemsInObjectGraph="2147483647" /> 
     </behavior> 
    </endpointBehaviors> 
    </behaviors> 
    <client>  
    <endpoint address="http://myserver/MyAppService/MyAppService.svc" 
    behaviorConfiguration="Behaviors.EndpointBehavior" 
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_iMyAppService" 
    contract="MyAppService.iMyAppService" name="BasicHttpBinding_iMyAppService" /> 
    </client> 
</system.serviceModel> 

そしてここでは、私のサーバー側のweb.configファイル(非関連のものが除去される)であります

<system.serviceModel> 
    <behaviors> 
    <serviceBehaviors> 
     <behavior> 
     <serviceMetadata httpGetEnabled="true"/> 
     <serviceDebug includeExceptionDetailInFaults="true"/> 
     </behavior> 
    </serviceBehaviors> 
    <endpointBehaviors> 
     <behavior name="Behaviors.EndpointBehavior"> 
     <dataContractSerializer maxItemsInObjectGraph="2147483647" /> 
     </behavior> 
    </endpointBehaviors> 
    </behaviors> 
    <bindings> 
    <basicHttpBinding> 
     <binding name="BasicHttpBinding_iMyAppService" 
      closeTimeout="00:01:00" 
     openTimeout="01:00:00" receiveTimeout="01:00:00" sendTimeout="01:00:00" 
     allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
     maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" 
     messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 
     useDefaultWebProxy="true"> 
     <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" 
      maxBytesPerRead="4096" maxNameTableCharCount="2147483647" /> 
     <security mode="None"> 
      <transport clientCredentialType="None" proxyCredentialType="None" 
      realm="" /> 
      <message clientCredentialType="UserName" algorithmSuite="Default" /> 
     </security> 
     </binding> 
    </basicHttpBinding> 
    </bindings> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/> 
    <services> 
    <service name="MyApp_WCFService.MyAppService"> 
     <host> 
     <baseAddresses> 
      <add baseAddress="http://localhost/MyAppService/"/> 
     </baseAddresses> 
     </host> 
     <endpoint address="" behaviorConfiguration="Behaviors.EndpointBehavior" binding="basicHttpBinding" contract="MyApp_WCFService.iMyAppService" bindingConfiguration="BasicHttpBinding_iMyAppService"> 
     <identity> 
      <dns value="localhost"/> 
     </identity> 
     </endpoint> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> 
    </service> 
    </services> 
</system.serviceModel> 
<system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"> 
    </modules> 
</system.webServer> 

これらは正しいですか?もしそうなら、私はこの仕事をするどちらの人にも欠けているものがありますか?

おかげ

+0

WCFサービスコンフィグレーションエディタを使用しているか、これらのファイルを手動で変更していますか? –

+0

ファイルを自動作成した後、ファイルを手動で変更しました。構成エディタは、変更なしで簡単な.configファイルでエラーを出します。 – Nullqwerty

+0

誰かが間違っている可能性のあるものを見ていますか? – Nullqwerty

答えて

1

これが完了しました。問題は、サーバーサイドのweb.configでは、maxItemsInObjectGraphの動作がエンドポイントの動作ではなく、サービス動作でなければならないということでした。

0

チェックアウトサービスのログを利用でき、それははるかに簡単

http://msdn.microsoft.com/en-us/library/ms732023.aspx

を開始するには、実際の問題を見つけることになり、あなたのweb.configファイルにこれを追加してから使用してファイルを検索しますビューア(SvcTraceViewer.exe)私にとっては(C:\プログラムファイル(x86の)\マイクロソフトのSDK \ Windowsの\ v7.0A \ビン)ここに位置しています

<system.diagnostics> 
    <sources> 
     <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing" > 
      <listeners> 
       <add name="ServiceModelTraceListener"/> 
      </listeners> 
     </source> 
     <source name="System.ServiceModel" switchValue="Verbose,ActivityTracing"> 
      <listeners> 
       <add name="ServiceModelTraceListener"/> 
      </listeners> 
     </source> 
     <source name="System.Runtime.Serialization" switchValue="Verbose,ActivityTracing"> 
      <listeners> 
       <add name="ServiceModelTraceListener"/> 
      </listeners> 
     </source> 
    </sources> 

    <sharedListeners> 
     <add initializeData="App_tracelog.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelTraceListener" traceOutputOptions="Timestamp"/> 
    </sharedListeners> 
</system.diagnostics> 
+0

しました。そこには例外がありますが、残念ながら私が既に持っていた情報以外の追加の情報は表示されません。特に私が探しているものは何ですか? – Nullqwerty

0

mexエンドポイントを削除しようとしましたか?

+0

ちょうど試しました。残念なことに影響はありません。とにかくありがとう – Nullqwerty

関連する問題