Stelios
Stelios

Reputation: 340

again The maximum message size quota for incoming messages (65536) has been exceeded

i know too many duplicates for this message but please give your lights here..

I am getting an entity from WCF Customer which contains a photo field in base64. I have no problem to get it on my android device

when i update lets say the phone of this customer and upload the entity in in wcf i get an error Entity too large

Please also note that.. If i debug my WCF from the solution right click debug and try to read this entity i am getting the error maximum message size quota for incoming messages has been exceeded

The strange is how is possible that i can read the entity on device but i cannot read it when debugging and i cannot upload it back when i save.

3 different things here..

When i connect from code behind to my service i do it like this

    ServiceEndPoint = New ServiceModel.EndpointAddress(New Uri("http://MyIpAddress:MyPort/WcfServiceLibrary1.Service1.svc"))
    Dim Binding As New BasicHttpBinding
    Binding.MaxReceivedMessageSize = 20000000

    MyService = New ServiceReference1.Service1Client(Binding, ServiceEndPoint)

and this is my Configuration

<system.serviceModel>
<client>
    <endpoint name="basicEndpoint"
        address="http://localhost:8733/Design_Time_Addresses/WcfServiceLibrary1/Service1/"
        binding="basicHttpBinding"
        bindingConfiguration="basicHttp"
        contract="WcfServiceLibrary1.IService1"
         >
    </endpoint>
</client>


<services>

  <service  name="WcfServiceLibrary1.Service1"  behaviorConfiguration="ServiceBehavior">
    <host>
      <baseAddresses>

        <add baseAddress="http://localhost:8452/Design_Time_Addresses/WcfServiceLibrary1/Service1/" />
      </baseAddresses>
    </host>
    <!-- Service Endpoints -->
    <!-- Unless fully qualified, address is relative to base address supplied above -->
    <endpoint address="http://localhost:8542/Design_Time_Addresses/WcfServiceLibrary1/Service1/"  binding="basicHttpBinding"     bindingConfiguration="basicHttp"    contract="WcfServiceLibrary1.IService1">

          <!--Upon deployment, the following identity element should be removed or replaced to reflect the 
          identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
          automatically.-->

      <!--<identity>
        <dns value="localhost" />
      </identity>-->
    </endpoint>
    <!-- Metadata Endpoints -->
    <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. -->
    <!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->

    <!--<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"  />-->
  </service>

</services>

 <bindings>

   <basicHttpBinding>
    <binding name="basicHttp"  allowCookies="true"    maxReceivedMessageSize="20000000" maxBufferSize="20000000" maxBufferPoolSize="20000000">
         <readerQuotas maxDepth="32" maxStringContentLength="20000000" maxArrayLength="20000000"  />
      <security mode="None"></security>
    </binding>
  </basicHttpBinding>

</bindings>



<behaviors>
  <serviceBehaviors>
    <behavior name="ServiceBehavior">
      <!-- To avoid disclosing metadata information, 
      set the values below to false before deployment -->
      <serviceMetadata httpGetEnabled="True" httpsGetEnabled="True" />
      <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
      <!-- To receive exception details in faults for debugging purposes, 
      set the value below to true.  Set to false before deployment 
      to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

Upvotes: 0

Views: 153

Answers (1)

Sujay Kulkarni
Sujay Kulkarni

Reputation: 88

Try changing all values of property in binding to 2147483647.

Try programmatically setting value as follows BasicHttpBinding binding = new BasicHttpBinding() {

MaxBufferSize = 2147483647,

MaxReceivedMessageSize = 2147483647

};

Upvotes: 1

Related Questions