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.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();
avaNate [ Fr, 18 Januar 2008 21:41 ] [ ID #1911145 ]
Microsoft » microsoft.public.dotnet.general » Bad Request (400) Error from POX WCF Service When Message Size > 6

Vorheriges Thema: Office Word like GUI
Nächstes Thema: how to reference COM dll from C# without the COM dll being registered in the registry?