0

I have a WCF REST service that is calling another self hosted WCF service on my server.

So it looks like this:

WCF Rest Service (Internet facing) -----> Application hosted WCF Service hosted on the same server (localhost on the server).

The point of this if to expose an endpoint on the REST service which accepts an image.

The REST service then calls the secondary service. When the secondary service returns to the main WCF service, it fails with the typical "MaxReceivedMessageSize (65373) exceeded". EVEN THOUGH I'm specifying (or at least I think I am) this in the app.config of the main WCF Service.

I've configured MaxReceivedMessageSize in two other areas and it works fine...EXCEPT for the Client configuration in the app.config of the REST service.

It seems that although I'm specifying this in the app.Config for calling WCF service, it's ignoring the binding. Is this something I can even do?

Here is my app.config for the main REST service:

    <?xml version="1.0"?>
    <configuration>

      <system.web>
        <compilation debug="true"/>
      </system.web>

      <connectionStrings>
        <add name="dbConnectStr"
             connectionString="Data Source=localhost;Initial Catalog=BDATA;Integrated Security=False;User Id=removed;Password=removed" providerName="System.Data.SqlClient" />
      </connectionStrings>

    <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<system.serviceModel>
        <bindings>
          <webHttpBinding>
            <binding name="BasicHttpBinding_IBIImageWarpService" maxReceivedMessageSize = "1000000"/>
          </webHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://localhost:8080/BIImageWarp" binding="webHttpBinding"
            bindingConfiguration="BasicHttpBinding_IBIImageWarpService"
            contract="ServiceReference1.IBIImageWarpService" name="BasicHttpBinding_IBIImageWarpService" />
        </client>
      </system.serviceModel>
    </configuration>

Please please please...I'm at my wits end here. This is the final piece of the puzzle for a large project I've been working on.

tronious
  • 1,547
  • 2
  • 28
  • 45
  • how about your client configuration, had you set the value as well? http://stackoverflow.com/questions/5459697/the-maximum-message-size-quota-for-incoming-messages-65536-has-been-exceeded – ah_hau Sep 15 '14 at 05:21
  • thanks for the reply. When you say client...which are you referring to exactly? In this case, the primary WCF service is the client and the secondary app hosted WCF service is the one being called and responding. – tronious Sep 15 '14 at 05:25
  • ok, what I mean is both side config file, already set the maxReceivedMessageSize ? you need to set it at both place, if already set, try to add maxBufferSize and readerQuotas as well. – ah_hau Sep 15 '14 at 05:31

0 Answers0