WCF域服务中的大数据保存问题 [英] Large data saving issue in wcf domain services

查看:103
本文介绍了WCF域服务中的大数据保存问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用wcf域服务和linq将二进制数据保存在数据库中.
但是我的web.config文件中存在一些问题.我已经在Google上搜索过设置web.config,以发送大数据和接收大数据.我发现很多链接,但对我没有帮助.谁能告诉我如何设置web.config文件.这是我的web.config文件...........

<!-
有关如何配置ASP.NET应用程序的更多信息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433


I am saving binary data in the database using wcf domain services and linq.
but there is some problem in my web.config file. I have searched over google for setting web.config for sending large data and receiving large data. I find many links but nothing helpful for me. Can any one tell me how to set up web,config file. here is my web.config file...........

<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433

<configuration>
  <configSections></configSections>
  <system.net>
    <mailSettings>
      <smtp from="noreply@localhost">
        <network host="localhost" port="25" />
      </smtp>
    </mailSettings>
  </system.net>
  <appSettings>
    <add key="report_recipient" value="" />
    <add key="showFullError" value="false" />
    <add key="ApplicationName" value="semPeople" />
    <add key="ServerUri" value="http://localhost:6699" />
    <add key="UploadPath" value="Upload" />
    <add key="microsoft.visualstudio.teamsystems.aspnetdevserver:/" value="27113;True;1360;1;-8589023398674391827" />
    <add key="microsoft.visualstudio.teamsystems.backupinfo" value="1;web.config.backup" />
  </appSettings>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <add name="DomainServiceModule" preCondition="managedHandler" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </modules>
    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>
  <system.web>
    <httpModules>
      <add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </httpModules>
    <httpRuntime maxRequestLength="2147483647" executionTimeout="100000" />
    <authentication mode="Forms">
      <forms loginUrl="~/login.aspx" defaultUrl="~/Default.aspx" name=".SEMYOU_RAPP" protection="All" path="/" timeout="180" />
    </authentication>
    <machineKey validationKey="BD52058A3DEA473EA99F29418689528A494DF2B00054BB7C" decryptionKey="684FC9301F404DE1B9565E7D952005579E823307BED44885" />
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </assemblies>
    </compilation>
  </system.web>
  <connectionStrings>
    <remove name="Entities" />
    <remove name="semyou_business_ext1Entities" />
    <remove name="semyou_businessEntities" />


        <add name="Entities" connectionString="metadata=res://*/semyouAuthenticationModel.csdl|res://*/semyouAuthenticationModel.ssdl|res://*/semyouAuthenticationModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=****;Initial Catalog=****;Persist Security Info=True;User ID=sab;Password=*****;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
    <add name="semyou_businessEntities" connectionString="metadata=res://*/semyouDB.csdl|res://*/semyouDB.ssdl|res://*/semyouDB.msl;provider=System.Data.SqlClient;provider connection string="Data Source=****;Initial Catalog=****;Persist Security Info=True;User ID=sab;Password=****;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
    <add name="semyou_business_ext1Entities" connectionString="metadata=res://*/DataAccess.SemPeopleEntities.csdl|res://*/DataAccess.SemPeopleEntities.ssdl|res://*/DataAccess.SemPeopleEntities.msl;provider=System.Data.SqlClient;provider connection string="Data Source=****;Initial Catalog=****;Persist Security Info=True;User ID=sab;Password=****;MultipleActiveResultSets=True;Application Name=EntityFramework"" providerName="System.Data.EntityClient" />

  </connectionStrings>
  <system.serviceModel>      
    <bindings>      
      <customBinding>
        <binding name="CustomBindingService" closeTimeout="00:10:00"

          openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
          <binaryMessageEncoding>
            <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"

              maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          </binaryMessageEncoding>
          <httpTransport maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"

            maxBufferSize="2147483647" />
        </binding>
      </customBinding>
    </bindings>
    <services>
      <service  name="SemPeople.Web.SemPeopleService" behaviorConfiguration="SemPeople-Web-SemPeopleService">
        <endpoint address="" binding="wsHttpBinding" contract="SemPeople.Web.SemPeopleService" />
        <endpoint address="/soap" binding="basicHttpBinding" contract="SemPeople.Web.SemPeopleService" />
        <endpoint address="/binary" binding="customBinding" bindingConfiguration="CustomBindingService" contract="SemPeople.Web.SemPeopleService" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="SemPeople-Web-SemPeopleService">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
        </behavior>
      </serviceBehaviors>
    </behaviors>

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
</configuration>

推荐答案

从您的配置中我看不到任何端点行为.创建一个端点行为并将maxitemsinobjectgraph设置为int32.MaxValue(2147483647).设置每个端点以使用该端点行为,并查看您的工作方式.
From your config I can not see any endpointbehaviors. Create an endpointbehavior and set the maxitemsinobjectgraph to int32.MaxValue (2147483647). Set each endpoint to use that endpointbehaviour and see how you get on.


这篇关于WCF域服务中的大数据保存问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆