返回首页

我工作的WCF应用程序中,我想在本地网络上传和下载大文件。为"400错误的请求",但我没有例外。

这是服务器端的配置文件如下


 

<configuration>

	<system.servicemodel>

    

    

		<services>

   <service behaviorconfiguration="TransferServiceBehavior" name="WcfTransferTest.transfer">

    <endpoint address="transfer" binding="basicHttpBinding" bindingconfiguration="TransferService">

     contract="WcfTransferTest.Itransfer" />

    <host>

     <baseAddresses>

      <add baseaddress="http://localhost:8001/" />

     </baseAddresses>

    </host>

   </endpoint></service>

  </services>

    

		<bindings>

   <basichttpbinding>

    <binding name="TransferService" maxbuffersize="2147483647" maxreceivedmessagesize="2147483647">

     messageEncoding="Text" transferMode="Streamed">

     <readerquotas maxdepth="2147483647" maxstringcontentlength="2147483647">

      maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />

    </readerquotas></binding>

   </basichttpbinding>

  </bindings>

    

		<behaviors>

      <servicebehaviors>

        <behavior name="TransferServiceBehavior">

          <servicemetadata httpgetenabled="true" />

          <datacontractserializer maxitemsinobjectgraph="2147483647" />

          <servicedebug includeexceptiondetailinfaults="true" />

          <servicethrottling>

               maxConcurrentCalls="500"

               maxConcurrentSessions="500"

               maxConcurrentInstances="500"/>

        </servicethrottling></behavior>

      </servicebehaviors>

		</behaviors>

    

		<servicehostingenvironment multiplesitebindingsenabled="false" />

	</system.servicemodel>

	<system.webserver>

		<modules runallmanagedmodulesforallrequests="true" />

	</system.webserver>

	<system.web>

		<compilation debug="true" /></system.web></configuration>

 


这是客户端的配置文件如下
{C}
当我设置客户端transferMode以缓冲可以上传像KB的小文件,并显示错误当文件超过1MB。但它不会有意义,因为我设置transferMode的在服务器端流和客户应该是相同的。
当客户端和服务都设置为流,我收到"错误的请求400"。花了我两天,我尝试了许多建议,人们说,它为他们的作品,但我的是不是。

在我的代码块的大小是65000

请告诉我具体的答案,像配置文件中的参数有错误。
可谁能告诉我如何解决这个错误?我尝试了许多解决方案,也许我缺少的东西在这里。
如何才能解决这个问题以上传大文件,通过流模式basicHttpBinding的吗?

提前感谢!

回答

评论会员: 时间:2