2011-10-18 6 views
1

メッセージを逆シリアル化しようとしているときにフォーマッタが例外をスローしました。パラメータhttp://tempuri.org/:GetFileResultを逆シリアル化しようとしてエラーが発生しました。 InnerExceptionメッセージが 'WindowsClient.CloudServiceProxy.GetFileResponse型のオブジェクトを逆シリアル化する際にエラーが発生しました。 XMLデータの読み取り中に最大配列長の制限(16384)を超えました。このクォータは、XMLリーダーの作成時に使用されるXmlDictionaryReaderQuotasオブジェクトのMaxArrayLengthプロパティを変更することによって増加させることができます。行1、位置41572 '。詳細については、InnerExceptionを参照してください。 私は サーバのweb.configファイルがWCF Webサービスのmax readerクォータに関する問題

<system.serviceModel> 
    <services> 
    <service behaviorConfigura 

tion="CloudServiceBehaviour" name="Web.CloudService"> 
     <endpoint name="CloudServiceClientEndPoint" bindingConfiguration="CloudBindingConfig" address="http://localhost:53243/CloudService.svc" binding="wsHttpBinding" contract="Web.ICloudService"></endpoint> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="CloudServiceBehaviour"> 
      <serviceMetadata httpGetEnabled="True" httpGetUrl=""/> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 

     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="CloudBindingConfig" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"> 
      <readerQuotas maxDepth="200" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    </system.serviceModel> 

とクライアントのweb.configあなたの問題を伝えるGetFileResponseオブジェクトを、デシリアライズ中にエラーがあるので、

<system.serviceModel> 
     <bindings> 
      <wsHttpBinding> 
       <binding name="CloudServiceClientEndPoint" closeTimeout="00:01:00" 
openTimeout="00:01:00" receiveTimeout="00:30:00" sendTimeout="00:01:00" 
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" 
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" 
allowCookies="false"> 
       <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" 
        maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
       <reliableSession ordered="true" inactivityTimeout="00:30:00" 
        enabled="false" /> 
       <security mode="Message"> 
        <transport clientCredentialType="Windows" proxyCredentialType="None" 
        realm="" /> 
        <message clientCredentialType="Windows" negotiateServiceCredential="true" 
        algorithmSuite="Default" /> 
       </security> 
       </binding> 
      </wsHttpBinding> 
     </bindings> 
     <client> 
      <endpoint address="http://localhost:53243/CloudService.svc" binding="wsHttpBinding" 
      contract="CloudServiceProxy.ICloudService" name="CloudServiceClientEndPoint" /> 
     </client> 
    </system.serviceModel> 
+1

クライアントweb.configに追加してみてください bindingConfiguration = "CloudServiceClientEndPoint" – MLF

答えて

2

であるこの問題を取得していますクライアント側のスタックにあります。

エンドポイントでbindingConfiguration名を指定するために省略したため、クライアント側バインディングではwsHttpBindingのデフォルト構成が使用されています。エンドポイント要素にbindingConfiguration="CloudServiceClientEndPoint"を追加すると、readerQuotas設定の大きな値が取得されます。

+0

はい、これは設定が欠落していました。この設定を追加した後は私のために働きました。ありがとうございます。 – Selwyn