Tag: readerquotas

以编程方式修改端点ReaderQuotas

我有一个服务的动态客户端。 如何更改其端点绑定的ReaderQuotas属性? 我试过这样但它不起作用…… DynamicProxyFactory factory = new DynamicProxyFactory(m_serviceWsdlUri); foreach (ServiceEndpoint endpoint in factory.Endpoints) { Binding binding = endpoint.Binding; binding.GetProperty(new BindingParameterCollection()).MaxArrayLength = 2147483647 binding.GetProperty(new BindingParameterCollection()).MaxBytesPerRead =2147483647; binding.GetProperty(new BindingParameterCollection()).MaxDepth = 2147483647; binding.GetProperty(new BindingParameterCollection()).MaxNameTableCharCount = 2147483647; binding.GetProperty(new BindingParameterCollection()).MaxStringContentLength = 2147483647; } 即使这样做,ReaderQuotas值仍然是默认值。 我也尝试过这样但仍然不起作用: DynamicProxyFactory factory = new DynamicProxyFactory(m_serviceWsdlUri); foreach (ServiceEndpoint endpoint in factory.Endpoints) { System.ServiceModel.Channels.BindingElementCollection bec = endpoint.Binding.CreateBindingElements(); […]