• WCF上传大文件配置


    WCF配置文件-Web.config

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <appSettings>
        <add key="db" value="Data Source=192.168.1.170;Initial Catalog=WSSExtend;User ID=sa;Password=123456" />
      </appSettings>
      <system.web>
        <compilation debug="true" targetFramework="4.0">
          <assemblies>
            <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
          </assemblies>
        </compilation>
        <httpRuntime maxRequestLength="2097151" />
      </system.web>
      <system.serviceModel>
        <!--解决大文件上传NotFound问题-->
        <bindings>
          <basicHttpBinding>
            <binding name="BBB" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
              <!--name=随意命名,但要与上面的bindingConfiguration="BBB"对应 -->
              <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" />
              <security mode="None"></security>
            </binding>
            <binding name="CoreBBB" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
              <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" />
              <security mode="None"></security>
            </binding>
          </basicHttpBinding>
        </bindings>
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false 并删除上面的元数据终结点 -->
              <serviceMetadata httpGetEnabled="true" />
              <!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息 -->
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
            <!--解决大文件上传NotFound问题-->
            <!--注:此处的name值要跟下面的behaviorConfiguration值对应-->
            <behavior name="A">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
            <behavior name="CoreA">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <!--解决大文件上传NotFound问题-->
        <services>
          <!--注1:此处的behaviorConfiguration值要跟上面的name值对应-->
          <!--注2:此处的name值不能随便修改,命名格式为:完全命名空间+类名 -->
          <service behaviorConfiguration="A" name="DataService.TaskService">
            <!--注1:此处的contract值不能随便修改,命名格式为:完全命名空间+类名 -->
            <!--注2:此处的bindingConfiguration值要与下面 binding name中的name值对应-->
            <endpoint address="" bindingConfiguration="BBB" binding="basicHttpBinding" contract="DataService.ITaskService" />
          </service>
          <service behaviorConfiguration="CoreA" name="DataService.CoreService">
            <endpoint address="" bindingConfiguration="CoreBBB" binding="basicHttpBinding" contract="DataService.ICoreService" />
          </service>
        </services>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="false" />
      </system.serviceModel>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
        <directoryBrowse enabled="true" />
      </system.webServer>
      <connectionStrings>
        <add name="WSSExtendEntities" connectionString="metadata=res://*/WSSExtendModel.csdl|res://*/WSSExtendModel.ssdl|res://*/WSSExtendModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=192.168.1.170;Initial Catalog=WSSExtend;Persist Security Info=True;User ID=sa;Password=123456;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
      </connectionStrings>
    </configuration>

    Silverlight跨域配置文件-clientaccesspolicy.xml

    <?xml version="1.0" encoding="utf-8" ?>
    <access-policy>
      <cross-domain-access>
        <policy>
          <allow-from http-request-headers="*">
            <domain uri="*"/>
          </allow-from>
          <grant-to>
            <resource path="/" include-subpaths="true"/>
          </grant-to>
        </policy>
      </cross-domain-access>
    </access-policy>
  • 相关阅读:
    博客第一篇:博客申请理由
    Cookie基础
    滚动篇————附一个简单单的自定义滚动条
    javascript中对字符串的操作总结
    javascript中创建对象的几种方式
    javascript中event汇总
    ...python scrapy
    Ubuntu 检测到系统出现问题 弹窗 嘿嘿
    万一哪天笔记全没了, 你真正记住的还有多少
    windows10安装mysql5.7.17是这样安装的吗?
  • 原文地址:https://www.cnblogs.com/ncore/p/2766498.html
Copyright © 2020-2023  润新知