Наша команда пытается создать приложение Windows (C #) для вызова службы WCF с помощью прокси-сервера в Интернете
Отображается исключение" Сервер совершил нарушение протокола. Section = ResponseStatusLine "при вызове службы WCF
Предложите решение этой проблемы / любое другое альтернативное решение
//Code for creating proxy
public static DevicesServiceClient CreateProxy()
{
var proxy = new DevicesServiceClient("BasicHttpBinding_IDevicesService");
BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.None;
binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
binding.UseDefaultWebProxy = false;
binding.ProxyAddress = new Uri(string.Format("http://{0}:{1}", "192.168.0.20","808"));
proxy.Endpoint.Binding = binding;
proxy.ClientCredentials.UserName.UserName = "Username";
proxy.ClientCredentials.UserName.Password = "Password";
}
Трассировка стека сервера:
в System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException (WebException webException, HttpRequest request, HttpWebRequest HttpAbortReason abortReason)
Сервер совершил нарушение протокола. Section = ResponseStatusLine "при вызове службы WCFПредложите решение этой проблемы / любое другое альтернативное решение
//Code for creating proxy public static DevicesServiceClient CreateProxy() { var proxy = new DevicesServiceClient("BasicHttpBinding_IDevicesService"); BasicHttpBinding binding = new BasicHttpBinding(); binding.Security.Mode = BasicHttpSecurityMode.None; binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None; binding.UseDefaultWebProxy = false; binding.ProxyAddress = new Uri(string.Format("http://{0}:{1}", "192.168.0.20","808")); proxy.Endpoint.Binding = binding; proxy.ClientCredentials.UserName.UserName = "Username"; proxy.ClientCredentials.UserName.Password = "Password"; }
Трассировка стека сервера:
в System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException (WebException webException, HttpRequest request, HttpWebRequest HttpAbortReason abortReason)
Сервер совершил нарушение протокола. Section = ResponseStatusLine "при вызове службы WCFПредложите решение этой проблемы / любое другое альтернативное решение
//Code for creating proxy public static DevicesServiceClient CreateProxy() { var proxy = new DevicesServiceClient("BasicHttpBinding_IDevicesService"); BasicHttpBinding binding = new BasicHttpBinding(); binding.Security.Mode = BasicHttpSecurityMode.None; binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None; binding.UseDefaultWebProxy = false; binding.ProxyAddress = new Uri(string.Format("http://{0}:{1}", "192.168.0.20","808")); proxy.Endpoint.Binding = binding; proxy.ClientCredentials.UserName.UserName = "Username"; proxy.ClientCredentials.UserName.Password = "Password"; }
Трассировка стека сервера:
в System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException (WebException webException, HttpRequest request, HttpWebRequest HttpAbortReason abortReason)
в ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply (тайм-аут TimeSpan)
в System.ServiceModel.Channels.RequestChannel.Request (сообщение сообщения, тайм-аут TimeSpan)
в System.ServiceModel.Dispatcher.RequestChannelBinder.Request (сообщение сообщения, тайм-аут TimeSpan)
в System.ServiceModel.Channels.ServiceChannel.Call (действие String, одностороннее логическое значение, ProxyOperationRuntime, Object [] ins, Object [] out, тайм-аут TimeSpan)
в System.ServiceModel.Channels.ServiceChannel.Call (действие String, одностороннее логическое значение, ProxyOperationRuntime операция, Object [] ins, Object [] out)
в System.ServiceModel.Channels.ServiceChannelProxy.InvokeService (IMethodCallMessage methodCall, операция ProxyOperationRuntime)
в System.ServiceModel.Channels.ServiceChannelProxy.Invoke (сообщение IMessage)Исключение повторно генерируется в [0]:
в System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage (IMessage reqMsg, IMessage retMsg)
в System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (MessageData & msgData, тип Int32)
at DevicesService.IDevicesService.CheckNetworkConnection (String ipAddress)Мой клиентский код в app.config
Мой серверный код в web.config