System.IO.IOException:由于意外的>数据包格式,握手失败了?

有谁知道这意味着什么?

System.Net.WebException:基础连接已关闭:发送时发生意外错误。 —> System.IO.IOException:由于意外的数据包格式,握手失败。 System.Net.Security.SslState.Ss上的System.Net.Security.SslState.StartReadFrame(Byte []缓冲区,Int32 readBytes,AsyncProtocolRequest asyncRequest)中的System.Net.Security.SslState.StartReceiveBlob(Byte []缓冲区,AsyncProtocolRequest asyncRequest)。 System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst,Byte [] buffer,AsyncProtocolRequest)上的System.Net.Security.SslState.StartSendBlob(Byte []传入,Int32计数,AsyncProtocolRequest asyncRequest)中的CheckCompletionBeforeNextReceive(ProtocolToken消息,AsyncProtocolRequest asyncRequest) asyncRequest)System.Net上的System.Net.Se.SlsStream.CallProcessAuthentication(对象状态)中的System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)处于System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup的System.Threading.ExecutionContext.runTryCode(Object userData) (TryCode代码,CleanupCode backoutCode,Object userData)在System.Threading.ExecutionContext.RunInternal(ExecutionContext executionCont) 在System.Net.TlsStream.Write(Byte [])的System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult结果)的System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback回调,对象状态)中的ext,ContextCallback回调,对象状态)在System.Net.ConnectStream.WriteHeaders(布尔异步)处的System.Net.PooledStream.Write(Byte []缓冲区,Int32偏移量,Int32大小)处的缓冲区,Int32偏移量,Int32大小)—内部exception堆栈跟踪的结束 – – 在System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan超时)处的System.Net.HttpWebRequest.GetResponse()处

编辑:

这是我打电话的方法:

_productsService = new ProductsPortTypeClient(); _productsService.GetResortProducts(GetProductsCredentials(),GetResortProductParams());

它看起来像SSL身份validation的问题,它在握手阶段失败,可能两个实现不兼容,你可以检查响应的WSDL格式,找出应该用于通信的格式,并检查你发送的格式是否符合用它(你可以使用任何类型的网络监控软件,例如Microsoft网络监视器)

在我的情况下,它是Skype阻止443端口。 转到Skype工具 – 高级连接并禁用“使用端口80和443进行连接……”

摘要:使用了错误的端口。

我的服务是在端口上运行的开发:58328但是下次我调试时它运行在端口:44315上,这导致了这个问题。 因此,将客户端端口更改为44315有助于解决问题!