WCF wsDualHttpBinding says 'Failed to allocate a managed memory buffer ...'

87 Views Asked by At

I am trying to upload a large object (300 MB) from client to service using 'wsDualHttpBinding'.

Using 'basicHttpBinding', I able to upload large object (1.5 GB file).

I need to use 'wsDualHttpBinding'. But, using 'wsDualHttpBinding', I able to upload 28 MB only.

If I upload 100 MB object, it says ''Failed to allocate a managed memory buffer ...'

Could you tell me, how to upload large object (300 MB) using 'wsDualHttpBinding'.

Thanks In Advance,

Murugan

Here is the configuration I am using:

  <wsDualHttpBinding>
    <binding name="Test"
        closeTimeout="04:10:00"
        openTimeout="04:10:00"
        receiveTimeout="04:10:00"
        sendTimeout="04:10:00"
        bypassProxyOnLocal="false"
        transactionFlow="false"
        hostNameComparisonMode="StrongWildcard"
        maxBufferPoolSize="2147483647"
        maxReceivedMessageSize="2147483647"
        messageEncoding="Mtom"
        textEncoding="utf-16"
        useDefaultWebProxy="true">

      <readerQuotas maxDepth="2147483647"
         maxStringContentLength="2147483647"
         maxArrayLength="2147483647"
         maxBytesPerRead="2147483647"
         maxNameTableCharCount="2147483647" />

      <reliableSession
          ordered="true"
          inactivityTimeout="04:10:00" />
      <security mode="Message">
        <message clientCredentialType="Windows"
                 negotiateServiceCredential="true" />
      </security>
    </binding>
  </wsDualHttpBinding>

And contracts

public interface IFileUploaderService
{
    [OperationContract]
    void Upload(MyFileInfo remoteFileInfo);
}

public interface IFileUploaderServiceCallBack
{
    [OperationContract(IsOneWay = true)]
    void OnNotificationSend(string message);
}

[MessageContract]
public class MyFileInfo : IDisposable
{
    [MessageBodyMember(Order = 1)]
    public System.IO.Stream FileByteStream;

    public void Dispose()
    {
        if (FileByteStream != null)
        {
            FileByteStream.Close();
            FileByteStream = null;
        }
    }
}
0

There are 0 best solutions below