0

9 つのフィールドを持つリストがあります。小さいリスト (たとえば 50 行) を渡すと、アプリケーションは正常に動作しています。より大きなリストを渡すと、サービスが「リモート サーバーが予期しない応答を返しました: (400) 不正な要求」という例外をスローします。例外。この問題を解決するのを手伝ってください。

私のWeb設定は以下の通りです

 <?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>
  <connectionStrings>
    <add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />

  </connectionStrings>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />

    <authentication mode="Windows">
            <!--<forms loginUrl="~/Account/Login.aspx" timeout="2880" />-->
    </authentication>
    <identity impersonate="false" />
    <membership>
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
             enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
             maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
             applicationName="/" />
      </providers>
    </membership>

    <profile>
      <providers>
        <clear/>
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
      </providers>
    </profile>

    <roleManager enabled="false">
      <providers>
        <clear/>
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
      </providers>
    </roleManager>

    <httpRuntime maxRequestLength="2147483647" executionTimeout="3600"/>

  </system.web>

  <system.webServer>
     <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
  <system.serviceModel>
    <behaviors>
      <endpointBehaviors >
        <behavior name="Behavior">
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IService1" closeTimeout="00:20:00"
        openTimeout="00:20:00" receiveTimeout="00:20:00" sendTimeout="00:20:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
          messageEncoding="Text" textEncoding="utf-8" 
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="None">
            <transport clientCredentialType="Windows" proxyCredentialType="Windows"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
        <binding name="BasicHttpBinding_IErrorService" closeTimeout="00:20:00"
        openTimeout="00:20:00" receiveTimeout="00:20:00" sendTimeout="00:20:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
          messageEncoding="Text" textEncoding="utf-8"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>            
        <binding name="BasicHttpBinding_ISecurityUserService" closeTimeout="00:20:00"
        openTimeout="00:20:00" receiveTimeout="00:20:00" sendTimeout="00:20:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
          messageEncoding="Text" textEncoding="utf-8" 
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="None">
            <transport clientCredentialType="Windows" proxyCredentialType="Windows"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:6789/Service1.svc" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference1.IService1"
        name="BasicHttpBinding_IService1" />
      <endpoint address="http://localhost:6789/ErrorService.svc" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_IErrorService" contract="ErrorServiceReference.IErrorService"
        name="BasicHttpBinding_IErrorService" />
      <endpoint address="http://localhost:6789/SecurityUserService.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISecurityUserService"
        contract="SecurityUserServiceReference.ISecurityUserService"
        name="BasicHttpBinding_ISecurityUserService" />          
    </client>
  </system.serviceModel>
</configuration>

私のwcf設定は以下の通りです

  <?xml version="1.0"?>
    <configuration>
      <connectionStrings>

        <add name="DEFAULT"  connectionString="server=DEV1;Port=52;database=UTIL;User=ara;password=me;Charset=iso_1;Connect Timeout=100" />

      </connectionStrings>
      <appSettings>
        <add key="DEFAULT_SERVER" value="UAT"/>
        <add key="DEFAULT_DATABASE" value="UTIL"/>
        <add key="DEFAULT_PORT" value="480"/>
        <add key="DEFAULT_USER" value="fator"/>
        <add key ="DEFAULT_PASSWORD" value="U212ajUyODY="/>
      </appSettings>
      <system.web>
        <compilation debug="true" targetFramework="4.0" />

          <httpRuntime maxRequestLength="2147483647" executionTimeout="3600"/>

      </system.web>
      <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior name="Behavior">
              <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above 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="true"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>

        <services>

        </services>

        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
     <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
      </system.webServer>

    </configuration>

以下のように、エンドポイントとバインディングを使用してサービス Web 構成を変更しました。しかし、それでも同じエラーが発生します

<?xml version="1.0"?>
<configuration>
  <connectionStrings>

    <add name="DEFAULT"  connectionString="server=DEV;Port=52;database=UTIL;User=ar;password=me3;Charset=iso_1;Connect Timeout=100" />

  </connectionStrings>
  <appSettings>
    <add key="DEFAULT_SERVER" value="UA"/>
    <add key="DEFAULT_DATABASE" value="UTIL"/>
    <add key="DEFAULT_PORT" value="45"/>
    <add key="DEFAULT_USER" value="fr"/>
    <add key ="DEFAULT_PASSWORD" value="Y="/>
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />

      <httpRuntime maxRequestLength="2147483647" executionTimeout="3600"/>

  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="Behavior">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above 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="true"/>
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>

    <services>
      <service name="Service.Service1" behaviorConfiguration="Behavior">
        <endpoint address=""
                  binding="basicHttpBinding"
                  bindingConfiguration="BasicHttpBinding_IService1"
                  contract="Service.IService1"
                  name="BasicHttpBinding_IService1" />
        <endpoint address="mex" 
                  binding="mexHttpBinding"
                  contract="IMetaDataExchange"></endpoint>
        <host>
          <timeouts openTimeout="00:30:00" />
        </host>
      </service>
      <service name="Service.ErrorService" behaviorConfiguration="Behavior">
        <endpoint address=""
                  binding="basicHttpBinding"
                  bindingConfiguration="BasicHttpBinding_IErrorService"
                  contract="Service.IErrorService"
                  name="BasicHttpBinding_IErrorService" />
        <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetaDataExchange"></endpoint>
        <host>
          <timeouts openTimeout="00:30:00" />
        </host>
      </service>
      <service name="Service.SecurityUserService" behaviorConfiguration="Behavior">
        <endpoint address=""
                  binding="basicHttpBinding"
                  bindingConfiguration="BasicHttpBinding_ISecurityUserService"
                  contract="Service.ISecurityUserService"
                  name="BasicHttpBinding_IErrorService" />
        <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetaDataExchange"></endpoint>
        <host>
          <timeouts openTimeout="00:30:00" />
        </host>
      </service>
    </services>
    <bindings>
      <basicHttpBinding>
      <binding name="BasicHttpBinding_IService1" closeTimeout="00:20:00"
        openTimeout="00:20:00" receiveTimeout="00:20:00" sendTimeout="00:20:00"
        allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
        maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
        messageEncoding="Text" textEncoding="utf-8" 
        useDefaultWebProxy="true">
        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
          maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />

        <security mode="None">
          <transport clientCredentialType="Windows" proxyCredentialType="Windows"
            realm="" />
          <message clientCredentialType="UserName" algorithmSuite="Default" />
        </security>
      </binding>
        <binding name="BasicHttpBinding_IErrorService" closeTimeout="00:20:00"
        openTimeout="00:20:00" receiveTimeout="00:20:00" sendTimeout="00:20:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
          messageEncoding="Text" textEncoding="utf-8"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
        <binding name="BasicHttpBinding_ISecurityUserService" closeTimeout="00:20:00"
        openTimeout="00:20:00" receiveTimeout="00:20:00" sendTimeout="00:20:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
          messageEncoding="Text" textEncoding="utf-8" 
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="None">
            <transport clientCredentialType="Windows" proxyCredentialType="Windows"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>

私が明示的に定義したエンドポイントとバインディングは、サービスによって使用されていないと思います。サービスが間違っている場合は修正してください

4

1 に答える 1