我正在使用自定義綁定的WCF服務,我設置了gzip以減少我的結果的長度。最近我們遷移到.NET Core,並且在我的核心項目中調用我的方法後,出現此錯誤呼叫WCF服務窗體Dotnet核心
接收到對
http://www.???.com:96/TicketCache.svc/mex
的HTTP響應時發生錯誤。這可能是由於服務端點綁定不使用HTTP協議。這也可能是由於HTTP請求上下文被服務器中止(可能是由於服務關閉)。查看服務器日誌獲取更多詳細信
後,我改變了我的配置在WCF並將其設置爲基本約束,它的工作
我搜索了很多和測試不同的方式很好,但我不能回答
BinaryMessageEncodingBindingElement binaryMessageEncodingBindingElement = new BinaryMessageEncodingBindingElement();
binaryMessageEncodingBindingElement.CompressionFormat = CompressionFormat.GZip;
HttpTransportBindingElement httpTransportBindingElement = new HttpTransportBindingElement();
httpTransportBindingElement.MaxReceivedMessageSize = 65536000;
httpTransportBindingElement.MaxBufferSize = 65536000;
CustomBinding customBinding = null;
customBinding = new CustomBinding(new BindingElement[] { binaryMessageEncodingBindingElement, httpTransportBindingElement });
customBinding.OpenTimeout = TimeSpan.FromMinutes(10);
customBinding.CloseTimeout = TimeSpan.FromMinutes(10);
customBinding.ReceiveTimeout = TimeSpan.FromMinutes(20);
customBinding.SendTimeout = TimeSpan.FromMinutes(10);
customBinding.CreateBindingElements();
var factory = new ChannelFactory<customBinding, new EndpointAddress("http://www.???.com:96/TicketCache.svc/mex"));
如何我可以解決這個問題嗎?
是服務啓動和運行,並且防火牆的訪問授權? – ColinM
我允許在防火牆的服務,並打開它 –