64K を超えるメッセージに対して maxreceivedmessagesize エラーが発生します。問題は、サーバーとクライアントの両方で既にすべてを変更しており、問題が解決していないことです。
サーバー上の私の web.config と、Silverlight クライアントの構成は次のとおりです。
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="secureobjectbind" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="GiveWeb.Services.ShopBehavior">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph="6553600" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="GiveWeb.Services.ShopBehavior"
name="GiveWeb.Services.Shop">
<endpoint address="" binding="basicHttpBinding"
bindingConfiguration="secureobjectbind"
contract="GiveWeb.Services.IShop">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding"
contract="IMetadataExchange" />
</service>
</services>
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<clear/>
<add prefix="http://www.ushop2give.com"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
</system.serviceModel>
シルバーライト クライアント
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IShop" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://web14.ai-host.com/Services/Shop.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IShop"
contract="ShopSVC.IShop" name="BasicHttpBinding_IShop" />
</client>
</system.serviceModel>
</configuration>
それでもエラーが発生するのはなぜですか?
わかりました、ここに投稿の情報があります...
エラーが 1 つ見つかりました。バインディング オブジェクトの最初の宣言は、System.ServiceModel.BasicHttpBinding ではなく System.ServiceModel.Channels.Binding でした。そのため、オブジェクトの MaxReceivedMessageSize のプロパティが表示されませんでした。
これを修正し、プロキシを作成する関数を作成しましたが、戻りメッセージに 65536 バイトを超えるとエラー メッセージが表示されます。
public static ShopSVC.ShopClient ShopClientProxy()
{
System.ServiceModel.EndpointAddress lxAddress = new System.ServiceModel.EndpointAddress(new Uri(Application.Current.Host.Source, "../Services/Shop.svc"));
System.ServiceModel.BasicHttpBinding lxBinding = new System.ServiceModel.BasicHttpBinding(System.ServiceModel.BasicHttpSecurityMode.Transport);
lxBinding.MaxReceivedMessageSize = 2147483647;
lxBinding.MaxBufferSize = 2147483647;
lxBinding.ReceiveTimeout = new TimeSpan(0, 5, 0);
return new GiveSL.ShopSVC.ShopClient(lxBinding, lxAddress);
}