Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I'm trying to increase my transfer limit between my silverlight app and its wcf service.

When i upload a 2kb image then the app works just fine but when I try to up a 30kb image then it doesn't.

I'm busy running in circles with this one. (googled and all)

This is my ServiceReferences.ClientConfig file

<<pre lang="xml">configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IService1" maxBufferSize="2147483647"
                    maxReceivedMessageSize="2147483647">
                    <security mode="None" />
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:1320/Service1.svc"
                binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_IService1"
                contract="ServiceReference1.IService1"
                name="LargeBuffer" />
        </client>
    </system.serviceModel>
</configuration

>


And this is my wcf service app.config file....
XML
<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="LargeBuffer" closeTimeout="00:01:00"
          openTimeout="00:01:00"
          receiveTimeout="00:10:00"
          sendTimeout="00:01:00"
          transferMode="Buffered"
          maxReceivedMessageSize="73400320" >
          <!--70MB-->
          <readerQuotas maxArrayLength="73400320" />
        </binding>
      </basicHttpBinding>
    </bindings>
    <services />
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel

>
Posted

In you service behavior, you can increase the quota to receive, by using the maxItemsInObjectGraph.

XML
<behavior>
    <serviceMetadata httpGetEnabled="true"/>
    <serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="6553600"/> <!--You can set this upto 2,147,483,647-->
  </behavior>
 
Share this answer
 
@PumbaPumba.

Tried it an still doesn't work.

Improvement to the situation. I manually added another Image into the sql db. So when it retrieves the information it work's fine but when I try todo an update from the silverlight app to the wcf it crash's (but still works with a image that is 2kb).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900