모든 시도를 업데이트되지 않는 엔드 포인트 실패 :WCF 바인딩 설정은 WCF 셀프 호스팅 서비스 엔드 포인트의 구성 설정을 변경하는
public void Start()
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.Name = "NAVBinding";
//--------------------START editing-------------------------------
TimeSpan interval = new TimeSpan(1, 50, 00); // all these following (inbetween comments) lines have no effect
binding.MaxReceivedMessageSize = 2147483647;
binding.MaxBufferSize = 2147483647;
binding.ReceiveTimeout = interval;
binding.OpenTimeout = interval;
binding.CloseTimeout = interval;
binding.SendTimeout = interval;
XmlDictionaryReaderQuotas readerQuotas = new XmlDictionaryReaderQuotas();
readerQuotas.MaxDepth = 2147483647;
readerQuotas.MaxStringContentLength = 2147483647;
readerQuotas.MaxArrayLength = 2147483647;
readerQuotas.MaxBytesPerRead = 2147483647;
readerQuotas.MaxNameTableCharCount = 2147483647;
binding.ReaderQuotas = readerQuotas;
//----------------------END editing---------------------------
binding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
Uri baseAddress = new Uri("http://localhost:8000/nav/customer");
Customer_Service service = new Customer_Service();
serviceHost = new ServiceHost(service, baseAddress);
serviceHost.AddServiceEndpoint(typeof(ICustomer_Service), binding, baseAddress);
OpenMetadataExchange(baseAddress);
service.navEventListner = this;
serviceHost.Open();
}
하지만 쉽게 wcfStorm 응용 프로그램의 도움으로 MaxReceivedMessageSize
속성을 변경할 수 있으며, 이 경우에는 실제로 변경됩니다. 그러나 서비스를 다시 시작하면 모든 것이 기본 설정으로 돌아갑니다 (예 : MaxReceivedMessageSize = 65536). 나는 무엇을
을 whrong하고있는 중이하세요? 새 값이 업데이트되도록 내 코드를 수정하는 방법?
어떻게 ** 설정이 작동하지 않는 것을 ** 알 수 있습니까? config 파일이 업데이트되기를 기대하십니까? 아니면 당신의 기대치는 무엇입니까? –
나는 설정이 65536보다 큰 데이터를 전송해야하는 메소드를 호출하려고하지 않음을 알고있다.이 경우 나는 (더 적은 양의 데이터를 전송하는 다른 메소드가 OK가된다) 오류가있다. wcf 테스트 응용 프로그램 (내 경우 wcfstorm)을 사용하여 MaxReceivedMessageSize 및 MaxBufferSize 매개 변수를 더 큰 값으로 변경하면 큰 데이터가있는 메소드가 문제없이 호출되고 완료됩니다. – rem
또한 app.config 파일 (클라이언트와 서버 기반 모두)을 가지고 놀아 보았지만 아무것도 도움이되지 않았습니다. 내 질문에 강조하지 않았다. 왜냐하면 그 C# 하드 코딩 된 설정이 더 많은 영향을 미쳤다고 생각하기 때문이다. (어쩌면 내가 틀 렸지만 사실, 처음에는 서버 측 서비스 앱에서 app.config를 갖고 있지 않았다. 두 파일 및 모든 (그 새로운 MESSAGESIZE 바인딩 매개 변수를 제외하고) 잘 작동. – rem