現時点でこの問題に完全に困惑しています。過去 2 日間、さまざまな記事やブログを読んで、推奨される変更のほとんどを行いましたが、まだこの問題が発生しています。
基本的に、配列オブジェクトをパラメーターとしてクライアントからサービスに渡しているため、上記のエラーが発生します。
200 レコードは問題なく処理できますが、たとえば 250 に設定すると、400 エラーが返されます。トレースなどを有効にしましたが、エラーが発生しても何もログに記録されません。クライアントとサービスの両方が同じ環境で実行されています (テスト目的) -windows 2008r2 両方の構成ファイルと、サービスの呼び出し方法も示します。
クライアント構成
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
</configSections>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<httpRuntime executionTimeout="180" maxRequestLength="2147483647" />
</system.web>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_FinHqclient" closeTimeout="00:25:00"
openTimeout="00:25:00" receiveTimeout="10:50:00" sendTimeout="00:25:00"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security>
<transport realm="" />
</security>
</binding>
</wsHttpBinding>
<basicHttpBinding>
<binding maxBufferPoolSize="2147483647" name="test" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" >
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="maxItemsInObjectGraphBehaviour">
<dataContractSerializer maxItemsInObjectGraph="2147483646" />
</behavior>
</endpointBehaviors>
</behaviors>
<client>
<endpoint address="http://server:8123/service.svc" behaviorConfiguration="maxItemsInObjectGraphBehaviour"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_FinHqclient"
contract="sfgServ.FinHqclient" name="WSHttpBinding_FinHqclient">
<identity>
<servicePrincipalName value="host/local" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
これはサーバー構成ファイルです。
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "c:\log\Traces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime executionTimeout="180" maxRequestLength="2147483647" />
</system.web>
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true"
logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
</diagnostics>
<protocolMapping>
<add scheme="http" binding="wsHttpBinding"/>
</protocolMapping>
<services>
<service name="SFG.CRM2011.WebServiceFinHqFinHq.Service" behaviorConfiguration="SFG.CRM2011.WebServiceFinHq.ServiceBehavior">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="SFG.CRM2011.WebServiceFinHq.BindConfig"
contract="sfgServ.IClientFinHQ" behaviorConfiguration="SFG.CRM2011.WebServiceFinHq.wsServiceEndpointBehavior">
</endpoint>
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" bindingConfiguration="higherMessageSize_MEX" address="mex" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="SFG.CRM2011.WebServiceFinHq.wsServiceEndpointBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483646" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="SFG.CRM2011.WebServiceFinHq.ServiceBehavior">
<serviceMetadata httpGetEnabled="true" policyVersion="Policy15" />
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
<behavior >
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true" policyVersion="Policy15"/>
<!-- 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="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
<wsHttpBinding >
<binding name="SFG.CRM2011.WebServiceFinHq.BindConfig" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" >
<security mode="None">
<transport clientCredentialType="None" />
<message establishSecurityContext="false" />
</security>
<reliableSession enabled="true" ordered="True" inactivityTimeout="00:10:00" />
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</wsHttpBinding>
<mexHttpBinding>
<binding name="higherMessageSize_MEX" />
</mexHttpBinding>
<basicHttpBinding >
<binding maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" >
<readerQuotas maxStringContentLength="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="9000000" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
以下は、クライアントでこのサービスを呼び出す方法です...
List<FUMStruct> fList = new List<FUMStruct>();
for (int i = 0; i < 250; i++)
{
var t = new FUMStruct();
t.clientID = "1234";
t.ClientCRMGUID = new Guid("9EACA7AE-FE7E-E211-956A-00505622E202");
t.CRMAccountCRMGUID = new Guid("A63D9ADC-0CFF-E211-94E9-00505622E202");
t.Balance = 200 + i;
fList.Add(t);
}
var serv = new FinHqclientClient();
serv.UpdateLastFUMGUID(fList.ToArray());