-
Nov 16th, 2011, 09:33 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] MaxReceivedMessageSize error
REceiving this error when trying to bring some customer data over from the server. I have changed the MaxReceivedMessageSize on the server side. I need to know how to do it on the client in the code. Here is my binding code.
Code:
SMC.Binding binding = VServerClient.CreateDefaultBinding();
String remoteAddress = VServerClient.EndpointAddress.Uri.ToString();
remoteAddress = remoteAddress.Replace("localhost", strIP);
EndpointAddress endpoint = new EndpointAddress(remoteAddress);
VServerClient client = new VServerClient(binding, endpoint);
I have this at the top of the code
Code:
using SMC = System.ServiceModel.Channels;
And this is the error
Code:
"The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize
Any help is appreciated.
-
Nov 16th, 2011, 11:07 AM
#2
Fanatic Member
Re: MaxReceivedMessageSize error
This will probably exist in the webConfig file of the client code.
in code could be something like:
Code:
BasicHttpBinding httpBinding = new BasicHttpBinding();
httpBinding.MaxReceivedMessageSize = 2147483775;
httpBinding.MaxBufferSize = 2147483775;
Last edited by Bill Crawley; Nov 16th, 2011 at 11:10 AM.
-
Nov 16th, 2011, 12:46 PM
#3
Thread Starter
Fanatic Member
Re: MaxReceivedMessageSize error
Do not have a web.config or app.config file in this project.
Last edited by mojo69; Nov 16th, 2011 at 12:56 PM.
-
Nov 17th, 2011, 04:16 AM
#4
Fanatic Member
Re: MaxReceivedMessageSize error
check out my code example. You should have these on your binding object.
-
Jan 22nd, 2012, 05:25 PM
#5
Thread Starter
Fanatic Member
Re: [RESOLVED] MaxReceivedMessageSize error
I have this in the app.config file for the server side of the project. I am setting the maxReceivedMessageSize here. When I run the client I am still getting the message about the size is too big at 65536. The client is a mobile device running CE, does this prevent the seting from taking effect?
Code:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="NewBinding0" maxBufferSize="10485760" maxReceivedMessageSize="10485760" />
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="VServerServiceWcf.VServerBehavior" name="VServerServiceWcf.VServer">
<endpoint address="" binding="basicHttpBinding" contract="VServerServiceWcf.IVServer">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:4910/Design_Time_Addresses/VServerServiceWcf/VServer/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="VServerServiceWcf.VServerBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|