469,140 Members | 1,225 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,140 developers. It's quick & easy.

Bad Request (400) Error from POX WCF Service When Message Size > 6

We're having an issue getting our POX service to accept messages over 65k for
some reason. When that threshold is breached, a 400 is issued by WCF...and it
doesn't make it anywhere into the service.

Code:

WebServiceHost host = new WebServiceHost(new
TreemapProfileService.ServiceImplementation.Treema pProfileServiceImplementation(), new Uri[] {new Uri( "http://localhost:8092/treemapSavedState" )});


CustomBinding binding = new CustomBinding();

// Encoder

TextMessageEncodingBindingElement encoder = new
TextMessageEncodingBindingElement();

encoder.MessageVersion = MessageVersion.None;

binding.Elements.Add(encoder);

// Transport

HttpTransportBindingElement transport = new HttpTransportBindingElement();

transport.TransferMode = TransferMode.Streamed;

transport.MaxBufferSize = int.MaxValue; ;

transport.MaxBufferPoolSize = int.MaxValue;
transport.MaxReceivedMessageSize = int.MaxValue;

binding.Elements.Add(transport);

// We will take about 10 minutes for our transmission.

binding.SendTimeout = TimeSpan.FromMinutes(10);

host.AddServiceEndpoint(typeof(TreemapProfileServi ce.ServiceContracts.ITreemapProfileService),
new WebHttpBinding(), "http://localhost:8092/treemapSavedState");
host.Open();

Console.WriteLine("Press any key to stop the service...");

Console.ReadLine();

host.Close();

Jan 18 '08 #1
0 3354

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by ThisIsMe | last post: by
8 posts views Thread by turnit \(removethis\) | last post: by
6 posts views Thread by Drew | last post: by
6 posts views Thread by Daniel Rimmelzwaan | last post: by
6 posts views Thread by Ammar | last post: by
2 posts views Thread by Learner | last post: by
1 post views Thread by Elias | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.