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

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

am 18.01.2008 21:41:02 von avaNate

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.TreemapProfileSe rviceImplementation(), 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(TreemapProfileService.Service Contracts.ITreemapProfileService),
new WebHttpBinding(), "http://localhost:8092/treemapSavedState");


host.Open();

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

Console.ReadLine();

host.Close();