如何启用.NET Web服务以接收大量数据?
我有一个.NET Web服务,它应该接收几个大文件并将它们保存在本地硬盘上的目录中。尝试调用Web服务的程序(在同一网络上的另一台计算机上运行)收到错误:"行太长"。
有什么建议吗?
谢谢, 路易斯。
CODE:
方式:
Public Function ReceiveFiles(ByVal FileContents As String,
ByVal FileInfo As List(Of String),
ByVal listBinaryFileContents As List(Of Byte()),
ByVal listStringFileContents As List(Of String)) As String() Implements IReceiveFiles.GetDataReceiveFiles
...
DATACONTRACT:
<OperationContract()> Function GetDataReceiveFiles(ByVal FileContents As String,
ByVal FileInfo As List(Of String),
ByVal listBinaryFileContents As List(Of Byte()),
ByVal listStringFileContents As List(Of String)) As String()
WEBCONFIG:
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="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="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>