How can I increase the maxReceivedMessageSize when calling a WCF from VB6?

713 views Asked by At

At the moment I have: 1 ) a WCF setup to return a block of xml (specifically it is the contents of a calendar from Exchange 2003). 2 ) a vb6 form with a command on it accessing the WCF via an object built on the service moniker including the content of the WSDL contract file.

This is working fine only when the string being passed across is of an acceptable size. When i attempt to return the whole xml generated on the WCF-side i encounter the following error: "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."

When i add a binding-configuration into the WCF app-config to increase the maxReceivedMessageSize, this has no effect - presumably as the VB6 client is blind to this. (the WSDL contract generated doesn't even include the value in its xml)

Reading around*, there is the suggestion that i need to make a similar config change on the client-side. So i have created a VB6.EXE.CONFIG file and copied the binding-configuration details to to this. i have then extended the moniker to include this : binding=WSHttpBinding_IExchange, bindingNamespace='Exchange', bindingConfiguration='ExchangeBinding'

I am however still receiving the same error message regarding the size quota.

when mis-spelling the binding or bindingNamespace elements of the moniker above i get an expected error, but when mis-spelling the bindingConfiguration element i get no error, as if this element is irrelevant anyway.

I seem to have the pieces but not the working solution at the moment. Any ideas anyone?

  • The obj object is declared to be of the interface proxy type. The moniker is then set to include only the address and the binding type. Since you’re using just the default settings for the wsHttpBinding, you aren’t required to supply a bindingConfiguration value. If you required overriding any of the default settings for the binding, you could supply an application configuration file with the name file.exe.config and place it in the program directory of the client
1

There are 1 answers

2
UnhandledExcepSean On

Personally, I would create a .NET COM exposed library that you call from the VB6. The .NET library could control all of the client binding and VB6 would be simply talking with a DLL and passing strings around.