.NET Framework Developer Center > .NET Framework Forums > Windows Communication Foundation (WCF) > how to set maxReceivedMessageSize for a vb6 client app that use a WCF service ...

Answered how to set maxReceivedMessageSize for a vb6 client app that use a WCF service ...

  • Monday, October 09, 2006 7:04 PM
     
     
    Hi
        I have a VB6 client app that calls in to WCF service hosted using netTcpBinding. The calls seems to work fine for other functions that returns small amount of data. But i have a function that returns a string (xml serialized dataset) and it exceeds the maxReceivedMessageSize(65536) and i get "RunTime error -2146233087 (80131501) - The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.". My vb client app is named vb6client.exe. So i added vb6clientapp.exe.config and added maxReceivedMessageSize="6553600" in the netTcpBinding section. But i still get this error.
    If i do the same on a WCF client program written in .net, it works fine and is able to receive the dataset.

    This is how i call it from my VB6 app

        Dim sc As WCFProxy.Service1Client
        Set sc = GetObject("service:address=net.tcp://localhost:1500/service1/NetTcpBinding, binding=netTcpBinding")
        sc.Accounts

    This is the contents of my config file

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <system.serviceModel>
            <bindings>
                <netTcpBinding>
                    <binding name="NetTcpBinding_IService1" closeTimeout="00:01:00"
                        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                        transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
                        hostNameComparisonMode="StrongWildcard" listenBacklog="10"
                        maxBufferPoolSize="524288" maxBufferSize="6553600" maxConnections="10"
                        maxReceivedMessageSize="6553600">
                        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                        <reliableSession ordered="true" inactivityTimeout="00:10:00"
                            enabled="false" />
                        <security mode="None">
                        </security>
                    </binding>
                </netTcpBinding>
            </bindings>
            <client>
                <endpoint address="net.tcp://localhost:1500/service1/NetTcpBinding"
                    binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IService1"
                    contract="IService1" name="NetTcpBinding_IService1">
                </endpoint>
            </client>
        </system.serviceModel>
    </configuration>

    Any help is much appreciated.

    Thanks
    Vinoth

Answers

  • Wednesday, October 25, 2006 8:01 PM
     
     Answered
    Hi Vinoth,  we encountered a similar problem and found a solution that you may want to try.

    First of all, we had to modify the GetObject call to include a bindingConfiguration.  In your case, the call would look like:

    GetObject("service:address=net.tcp://localhost:1500/service1/NetTcpBinding,binding=netTcpBinding, bindingConfiguration=NetTcpBinding_IService1
    ")

    Also, it wasn't an issue in your case, but we noticed that
    maxReceivedMessageSize and maxBufferSize must be equal for the moniker to load at all.

    Hope this helps.


All Replies

  • Tuesday, October 17, 2006 8:06 PM
     
     
    I still haven't figured out a way to do this. I would really appreciate the help of the gurus here. Please help.
  • Wednesday, October 25, 2006 8:01 PM
     
     Answered
    Hi Vinoth,  we encountered a similar problem and found a solution that you may want to try.

    First of all, we had to modify the GetObject call to include a bindingConfiguration.  In your case, the call would look like:

    GetObject("service:address=net.tcp://localhost:1500/service1/NetTcpBinding,binding=netTcpBinding, bindingConfiguration=NetTcpBinding_IService1
    ")

    Also, it wasn't an issue in your case, but we noticed that
    maxReceivedMessageSize and maxBufferSize must be equal for the moniker to load at all.

    Hope this helps.


  • Thursday, October 26, 2006 9:09 PM
     
     
    Great. This works. Thanks a lot for your help.