ASP.NET によって .svc ファイルでホストされている WCF Web サービスがあります。.svc ファイルには次の構成が含まれています。
<%@ ServiceHost Language="C#" Debug="true" Service="assembly.IPriceListProvider, assembly" Factory="Autofac.Integration.Wcf.AutofacServiceHostFactory, Autofac.Integration.Wcf" %>
web.config には、WCF の構成が含まれています。バインディング構成は次のとおりです。
<binding name="basicHttpBinding_PriceListProvider" maxBufferSize="10485760"
maxReceivedMessageSize="10485760">
<readerQuotas maxArrayLength="16384000" />
</binding>
サービスをテストするには、.svc ファイルをクリックして F5 をクリックします。WCF テスト クライアントが開きます。しかし、構成が変更されました。私が明示的に定義した値には、デフォルト値があります。
<binding name="basicHttpBindingEndPoint_PriceListProvider" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
**maxBufferSize="65536"** maxBufferPoolSize="524288" **maxReceivedMessageSize="65536"**
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" **maxArrayLength="16384"**
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
構成が変更されるのはなぜですか? 元の値を保持するにはどうすればよいですか?
簡素化された .svc 構成について聞いたことがあります。web.config で明示的に指定しなくても、.svc の既定のバインドが構成されます。それは本当ですか?