0

How do I enable a .NET Web Service to Receive Large Amounts of Data ?

I have a .NET Web Service which should receive several large files and save them in a directory on the local hard disk. The program (running on another computer on the same network) that tries to call the Web service receives the error: "Line is too long".

Any suggestions?

Thanks, Luis.

CODE:

METHOD:

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>

0 Answers0