Click here to Skip to main content
11,492,691 members (47,535 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WCF service
I got this erro msg wehn trying to upload more than 64kb image byte array using wcf service


i want to solve this out but i can't solve it

Here Is my wcf config file





maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />




and here is my client web.config file




bindingConfiguration="BasicHttpBinding_ThePTSearchServiceI"
contract="WCFRef.ThePTSearchServiceI" name="BasicHttpBinding_ThePTSearchServiceI" />






<!--



-->
<!--

name="BasicHttpBinding_ThePTSearchServiceI">

address="http://localhost:6198/ThePTSearch.svc"
contract="WCFRef.ThePTSearchServiceI"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_ThePTSearchServiceI" />

address="http://localhost:6198/ThePTSearch.svc"
contract="WCFRef.ThePTSearchServiceI"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_ThePTSearchServiceI" />

-->




idon't know why this error was occure
Posted 14-Apr-13 21:30pm
Comments
Naz_Firdouse at 15-Apr-13 3:19am
   
Not sure about the issue because you did not posted the full config file
check these links. They might help you
http://stackoverflow.com/questions/2585256/wcf-service-name-binding-name
http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/a19d463f-833e-42a0-afcc-7d5a47704f7f/
http://stackoverflow.com/questions/15340038/the-remote-server-returned-an-error-413-request-entity-too-large
ryanb31 at 15-Apr-13 15:40pm
   
If you google the error you will see lots of suggestions. I had this issue before and can't remember which specific setting to change.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

U may add or change the setting in the service web config file .

<bindings>
<wsHttpBinding>
<binding name="CustomWSBindingHttp" maxReceivedMessageSize="2147483647">
<reliableSession enabled="false"/>
</binding>
</wsHttpBinding>
<netTcpBinding>
<binding name="CustomWSBindingTcp">
<reliableSession enabled="true"/>
</binding>
</netTcpBinding>
</bindings>

Note:

U mast need to put maxReceivedMessageSize="2147483647"
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

please set you webconfig setting like below, its work for me like charm.

<system.serviceModel>
     <services>
      <service name="RGB2LEDWebService.RGB2LED">
        <endpoint name="http" binding="basicHttpBinding" contract="RGB2LEDWebService.IRGB2LED" />
      </service>
    </services>
    <bindings>
      <basicHttpBinding>
        <binding maxReceivedMessageSize="2147483647" />
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
         <behavior>
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
 
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior>
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <protocolMapping>
      <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 454
1 Maciej Los 286
2 F-ES Sitecore 224
3 KarstenK 210
4 CPallini 208
0 Sergey Alexandrovich Kryukov 10,062
1 OriginalGriff 8,620
2 Sascha Lefèvre 3,609
3 Maciej Los 3,372
4 Richard Deeming 2,500


Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 2 Jul 2014
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100