2

I have a silverlight app that is calling a WCF service in another project (same solution) Problem is I get the all so common error 65536 I have read tons of articles and I have tried everything still getting this message.

Here is my Web Service

<system.web>
  <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
  <httpRuntime maxRequestLength="2147483647"/>
  <customErrors mode="Off"/>
</system.web>
<system.serviceModel>
  <services>
    <service behaviorConfiguration="ServiceBehavior" name="MyRemoteHostService">
      <endpoint address="" binding="basicHttpBinding" 
                bindingConfiguration="BasicHttpBinding_MyRemoteHostService"
                contract="MyServiceReference.MyRemoteHostService" />

      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    </service>
  </services>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="false"
                             multipleSiteBindingsEnabled="true" />
  <bindings>
    <basicHttpBinding>
      <binding name="BasicHttpBinding_MyRemoteHostService"
               maxBufferPoolSize="2147483647"
               maxReceivedMessageSize="2147483647"
               maxBufferSize="2147483647">
        <readerQuotas maxArrayLength="2147483647"
                      maxBytesPerRead="2147483647"
                      maxDepth="2147483647"
                      maxNameTableCharCount="2147483647"
                      maxStringContentLength="2147483647" />
      </binding>
    </basicHttpBinding>
  </bindings>
  <behaviors>
    <serviceBehaviors>
      <behavior name="ServiceBehavior">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="false" />
        <dataContractSerializer maxItemsInObjectGraph="2147483647" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>
<system.webServer>
  <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

and here is my client side ServiceReferences.ClientConfig

<system.web>
  <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
  <httpRuntime maxRequestLength="2147483647"/>
  <customErrors mode="Off"/>
</system.web>
<system.serviceModel>
  <bindings>
    <basicHttpBinding>
      <binding name="BasicHttpBinding_MyRemoteHostService" 
               closeTimeout="00:01:00"
               openTimeout="00:01:00" 
               receiveTimeout="00:05:00" 
               sendTimeout="00:02:00"
               maxBufferSize="2147483647" 
               maxReceivedMessageSize="2147483647">
        <security mode="None"></security>
      </binding>
    </basicHttpBinding>
  </bindings>
  <client>
    <endpoint address="http://localhost:2622/MyRemoteHostService.svc"
              binding="basicHttpBinding"
              bindingConfiguration="BasicHttpBinding_MyRemoteHostService"
              contract="MyServiceReference.MyRemoteHostService"
                name="BasicHttpBinding_MyRemoteHostService" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </client>
</system.serviceModel>
Tim
  • 28,212
  • 8
  • 63
  • 76
user958015
  • 21
  • 1
  • 5
  • 1
    There got to be **gazillions** of those questions on SO already - did you **SEARCH** before posting yet another one of those??? Please search!! I'm sure you'll find tons of answers!! – marc_s Oct 17 '11 at 17:25
  • 1
    Duplicate of [The maximum message size quota for incoming messages (65536) has been exceeded](http://stackoverflow.com/questions/7232355/the-maximum-message-size-quota-for-incoming-messages-65536-has-been-exceeded) and a **great many more** of those questions on SO..... – marc_s Oct 17 '11 at 17:26

4 Answers4

0

Take a look in the client config file. I suspect that's where your error is comming from.

DenaliHardtail
  • 27,362
  • 56
  • 154
  • 233
  • The client config has everything set to 2147483647 – user958015 Oct 17 '11 at 17:31
  • The client config has everything set to 2147483647 Also this is the passed in value that exceeds the limit, not recieved...many said set – user958015 Oct 17 '11 at 17:32
  • Ctrl + Shift + F, Find "65536", look in Entire Solution. Repeat in the service solution, if separate from client solution. That value has to be out there somewhere. – DenaliHardtail Oct 17 '11 at 17:45
  • Ctrl + Shift + F, Find "65536" brings back nothing – user958015 Oct 17 '11 at 18:07
  • when I put readerQuotas in the ServiceReferences.ClientConfig I get The element 'binding' has an invalid child element 'readerQuotas'... simular with maxBufferPoolSize, on that one I get the 'maxBufferPoolSize' is not declared – user958015 Oct 17 '11 at 20:19
0

Try this:

<binding name="higherMessageSize" maxReceivedMessageSize="2147483647">
     <readerQuotas maxStringContentLength="2147483647" />
</binding>
strickland
  • 1,943
  • 5
  • 21
  • 40
0

I found the issue; the namespace was not set in the service name

<service behaviorConfiguration="ServiceBehavior" name="MyRemoteHostService"> 

changed to

<service behaviorConfiguration="ServiceBehavior" name="My.Framework.Web.MyRemoteHostService"> 
user958015
  • 21
  • 1
  • 5
0

Thanks user958015 I solved it the same way you did, i din't have this part on the web service side

<services>
<service behaviorConfiguration="ServiceBehavior" name="MyRemoteHostService">
  <endpoint address="" binding="basicHttpBinding" 
            bindingConfiguration="BasicHttpBinding_MyRemoteHostService"
            contract="MyServiceReference.MyRemoteHostService" />

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

the "readerQuotas" attribute doesn't exist in silverlight, you just have to make sure you have the same attributes in web service and client, and make sure of writing the name and namespace in the web service side

Irving r
  • 108
  • 1
  • 7