zoukankan      html  css  js  c++  java
  • Silverlight保存大数据到WCF出现Not Found问题

    Silveright调用WCF保存大数据时,直接在客户端报“ 远程服务器返回了错误:Not Found ”问题,少量是没问题,如下图:

    后面在这个文章中找到解决办法: http://www.cnblogs.com/yjmyzz/archive/2011/06/29/2093829.html

    顺道贴出来一下,有需之则取之。

    ServiceReferences.ClientConfig 客户配置文件:

    <configuration>
      <system.serviceModel>
        <bindings>
    
          <basicHttpBinding>
            <binding name="BasicHttpBinding_IModuleAService" maxBufferSize="2147483647"
                maxReceivedMessageSize="2147483647"
                     openTimeout ="00:10:00"
                     receiveTimeout ="00:10:00"
                     sendTimeout ="00:10:00"
                     closeTimeout ="00:10:00">
              <security mode="None" />
            </binding>
          </basicHttpBinding>
    
          <!--下面这个节点是关键,通讯数据量-->
          <customBinding>
            <binding name="BasicHttpBinding_ModuleAService">
              <textMessageEncoding messageVersion="Default" writeEncoding="utf-8" />
              <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" transferMode="Buffered" />
            </binding>
          </customBinding>
    
        </bindings>
        <client>
          <endpoint address="http://localhost:77886/ModuleAService.svc"
              binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IModuleAService"
              contract="ModuleAService.IModuleAService" name="BasicHttpBinding_IModuleAService" />
        </client>
      </system.serviceModel>
    </configuration>

    Web.Config 服务端配置文件:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <configSections> </configSections>
    
      <system.web>
        <compilation debug="true" targetFramework="4.5" />
        <httpRuntime targetFramework="4.5" maxRequestLength="102400" />
      </system.web>
      <system.serviceModel>
        <services>
          <service behaviorConfiguration="BasicHttpBehavior" name="ModuleAService.ModuleAService">
            <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IModuleAService"  contract="ModuleAService.IModuleAService" />
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
    
            <behavior name="BasicHttpBehavior">
              <serviceThrottling maxConcurrentSessions="500" maxConcurrentInstances="500" maxConcurrentCalls="500" />
              <serviceDebug includeExceptionDetailInFaults="true" />
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
    
              <serviceTimeouts transactionTimeout="00:10:00" />
            </behavior>
    
          </serviceBehaviors>
    
        </behaviors>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
        <bindings>
          <basicHttpBinding>
            <binding name="BasicHttpBinding_IModuleAService" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" 
                     sendTimeout="00:10:00" receiveTimeout="00:10:00" closeTimeout="00:10:00" openTimeout ="00:10:00" messageEncoding="Text"
                     transferMode="Streamed" useDefaultWebProxy="true">
    
              <readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    
              <security mode="None" >
                <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
    
            </binding>
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="" binding="basicHttpBinding"  bindingConfiguration="BasicHttpBinding_IModuleAService" contract="ModuleAService.IModuleAService" name="" />
        </client>
      </system.serviceModel>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
        <directoryBrowse enabled="true" />
      </system.webServer>
    </configuration>
  • 相关阅读:
    ORACLE数据库——触发器的创建和使用
    Oracle——游标的创建和使用
    Oracle数据库和表的操作
    JavaScript中的this,call,apply使用及区别详解
    jQuery插件开发的五种形态小结
    前端图片上传预览
    location.pathname:返回URL的域名(域名IP)后的部分。
    使用Selectivizr让IE6~8支持CSS3
    respond.js有什么作用?
    截取url参数
  • 原文地址:https://www.cnblogs.com/dzone/p/4275351.html
Copyright © 2011-2022 走看看