WCFサービスコミュニケーションによる例外のパラメータサイズ
-
26-09-2019 - |
質問
私にはピWeb法をとるにXElementオブジェクトとしてパラメータとします。のためのXMLファイルのサイズは600KB)この作品は、イブレア城、イブレア大し、この大きなXMLファイル(約5MB)を取得しまCommunicationExceptionます。
しかし、私のメッセージのサイズのための私に結合する。以下のServiceModelた。config:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="BIMIntegrationWS.metadataBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="BIMIntegrationWS.IntegrationService.customBinding0"
closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:10:00">
<binaryMessageEncoding>
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binaryMessageEncoding>
<httpTransport maxBufferPoolSize="2147483647" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647" />
</binding>
</customBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<services>
<service name="BIMIntegrationWS.BIMIntegrationWS" behaviorConfiguration="BIMIntegrationWS.metadataBehavior">
<endpoint address="" binding="customBinding" bindingConfiguration="BIMIntegrationWS.IntegrationService.customBinding0"
contract="BIMIntegrationWS.IBIMIntegrationService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
クライアント、ClientConfigようになります:
<system.serviceModel>
<bindings>
<customBinding>
<binding name="CustomBinding_IBIMIntegrationService">
<binaryMessageEncoding />
<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://localhost:1895/IntegrationService.svc"
binding="customBinding" bindingConfiguration="CustomBinding_IBIMIntegrationService"
contract="BIMIntegrationService.IBIMIntegrationService" name="customBindingEndpoint" />
</client>
</system.serviceModel>
感謝。
解決
サービスアプリケーションのためのあなたのweb.configファイルに次のコードを追加してみます:
<system.web>
<httpRuntime maxRequestLength="16384" /> <!-- 16MB -->
</system.web>
は、Webサーバーでサービスをホストする場合、あなたはまた、Webサーバに許可要求サイズを微調整する必要があります。
敬具、 ラディスラフ
他のヒント
たぶんあなたのXElementがあまりにも多くのノード/子要素を持っており、あなたがより大きな何かにdataContractSerializer下maxItemsInObjectGraph属性を設定する必要がありますか?
きょ変更する必要の値の属性 <readerQuotas />
サブ要素の <binaryMessageEncoding />
.
詳しくは:http://msdn.microsoft.com/en-us/library/ms731325.aspx http://forums.silverlight.net/forums/p/88704/205040.aspx
更新:
きく増加の maxAllowedContentLength
このように:http://social.msdn.microsoft.com/Forums/en/wcf/thread/e6e21132-ad3f-4135-8ab9-77923b099907
はIISにVSホストオフとちょうど展開に目を向けると、それにPINGを与える方法を知っていますか。あなたのdevのボックスに通常IIS 7だけで罰金を行います。あなたはまだだけで瞬時F5の満足感を持っていますが、あなたのocodeが起動時に死んでいないので、あなたが拳ラインからの場合は、とにかく見ている必要はありません:-)
はありません、デバッガなどを添付することができます あなたは非常に早い添付する必要があります場合は、あなたがすべてではtounchない何もしないmimimal方法を作ることができる可能性があり、ちょうどint型constnatを返します - 。あなたが添付できるように、単にアプリケーションプールを起動するには、