写了一个windows服务程序,开启一个线程一直在扫描数据,有数据则通过调用webservice方法,发送。
但是服务注册后,启动程序,调用WebService不成功。
TCP 错误代码 10060: 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。 61.132.240.50:80。 Server stack trace:
在 System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
在 System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
在 System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
在 System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)Exception rethrown at [0]:
在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
在 PZT.ServiceReference1.ThirdInterfaceSoap.Login(LoginRequest request)
不过在控制台程序测试了一下单独调用WebService方法,是可以成功调用的。不知道这是什么原因?
但是服务注册后,启动程序,调用WebService不成功。
TCP 错误代码 10060: 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。 61.132.240.50:80。 Server stack trace:
在 System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
在 System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
在 System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
在 System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)Exception rethrown at [0]:
在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
在 PZT.ServiceReference1.ThirdInterfaceSoap.Login(LoginRequest request)
不过在控制台程序测试了一下单独调用WebService方法,是可以成功调用的。不知道这是什么原因?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货