错误:基础连接已关闭. [英] error: underlying connection was closed.

查看:605
本文介绍了错误:基础连接已关闭.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我已经使用nusoap Web服务创建了一个VB.NET Windows应用程序.我的应用程序中有一个模块,每2.5秒运行一次(在计时器滴答事件中).在计时器的每个滴答事件中,此模块都会在后台工作程序内调用Web服务方法.它以XML返回一些记录,然后将此XML绑定到DatagridView.现在的问题是有时它显示此错误消息:

Hi,
I have created a VB.NET windows application using nusoap web services. There is a module in my application which runs every 2.5 sec (on timer tick event). On each tick event of the timer this module calls a web service method inside a background worker. It returns some records in XML and then this XML is bound to a DatagridView. Now the problem is sometime it shows this error message:

The underlying connection was closed : A connection that was expected to be kept alive was closed.



我如何解决此问题,因为我没有在nusoap中找到保持活动的方法.

在此先感谢您!



How can I solve this issue, because I didn''t find keep alive method present in nusoap.

Thanks in advance!

推荐答案

调用Web服务时,请使用.NET框架WebRequest进行此操作.如果您是,则可以将WebRequest对象的KeepAlive属性设置为false.这可能会解决您的问题.
如果您将相关的代码位张贴在发生错误的地方,并且异常的堆栈跟踪也将有所帮助,这将有助于我们解决此问题.

最好的问候,
曼弗雷德(Manfred)
When you call the webservice do you do this using the .NET frameworks WebRequest. If you are you can set the KeepAlive property on the WebRequest object to false. This might resolve your issue.
It would help us to solve this if you would post the relevant code bits where the error occurs and the stacktrace of the exception would also help.

Best Regards,
Manfred


这篇关于错误:基础连接已关闭.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆