バインディング属性をクライアントサービス構成にプルするのに問題があります。サーバー上で(Windowsサービスとして)WCFサービスを実行しています。最初にバインディングに名前を付けて、bindingConfiguration属性を使用してサービスに適用しようとしましたが、機能しませんでした。他の人がname属性を削除してバインディングをデフォルトにしたのを見たので、それが今のところです。WCFプロジェクトのアプリ構成は次のようになります。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding maxReceivedMessageSize="6553600" maxBufferSize="6553600" />
</basicHttpBinding>
</bindings>
<client />
<services>
<service ... />
<service name="PdfWriterService.Service4">
<host>
<baseAddresses>
<add baseAddress="http://rsmreports:8733/PdfWriterService/v4" />
</baseAddresses>
</host>
<!-- Service Endpoints -->
<!-- Unless fully qualified, address is relative to base address supplied above -->
<endpoint address="" binding="basicHttpBinding" contract="PdfWriterService.IService4">
<!--
Upon deployment, the following identity element should be removed or replaced to reflect the
identity under which the deployed service runs. If removed, WCF will infer an appropriate identity
automatically.
-->
<!--<identity>
<dns value="localhost" />
</identity>-->
</endpoint>
<!-- Metadata Endpoints -->
<!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. -->
<!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information,
set the value below to false before deployment -->
<serviceMetadata httpGetEnabled="True" />
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
クライアントサイト(サービス部分)のweb.configは次のようになります。
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_PdfWriterServiceV4" 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>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://rsmreports:8733/PdfWriterService/v4"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_PdfWriterServiceV4"
contract="PdfWriter.PdfWriterServiceV4" name="BasicHttpBinding_PdfWriterServiceV4" />
</client>
</system.serviceModel>
クライアントにこれらの属性(maxReceivedMessageSizeおよびmaxBufferSize)を持たせるために欠けているものはありますか?
ありがとう!