我在我的控制檯應用程序託管WCF服務如下:MaxReceivedMessageSize在WCF的控制檯應用程序託管服務
static void Main(string[] args)
{
Uri baseAddress = new Uri("http://localhost:8080/Test");
// Create the ServiceHost.
using (ServiceHost host = new ServiceHost(typeof(TestService), baseAddress))
{
// Enable metadata publishing.
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
host.Description.Behaviors.Add(smb);
host.Open();
Console.WriteLine("The Test service is ready at {0}", baseAddress);
Console.WriteLine("Press <Enter> to stop the service.");
Console.ReadLine();
// Close the ServiceHost.
host.Close();
}
}
我有一個客戶在Windows應用商店(WinRT的)應用程序。我越來越
「(413)請求實體過大」
試圖通過一個大的字節數組時。我如何通過代碼在我的服務中設置MaxReceivedMessageSize
?