none
wcf RRS feed

答案

  • Hi,

    您需要在WCF客户端设置MaxReceivedMessageSize 这个属性,以下代码您可以参考:

    string strUri = "http://localhost:8000/StaffService";
                BasicHttpBinding binding = new BasicHttpBinding();
                binding.MaxReceivedMessageSize = 20000001;
                binding.CloseTimeout = TimeSpan.FromMinutes(2);
                binding.ReceiveTimeout = TimeSpan.FromMinutes(2);
                binding.OpenTimeout = TimeSpan.FromMinutes(2);
                binding.SendTimeout = TimeSpan.FromMinutes(2);
                staffClient = new svcStaff.StaffClient(binding, new EndpointAddress(strUri));

    您也可以参考以下链接:

    http://msdn.microsoft.com/en-us/library/system.servicemodel.httpbindingbase.maxreceivedmessagesize.aspx

    祝您好运!


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    2013年9月30日 4:43
    版主