当前位置: 代码迷 >> Web Service >> 啊为什么调用webservice方法的时候总提示SERVER ERROR的异常
  详细解决方案

啊为什么调用webservice方法的时候总提示SERVER ERROR的异常

热度:359   发布时间:2016-05-02 02:54:16.0
求救啊!为什么调用webservice方法的时候总提示SERVER ERROR的错误
我在本机上调用远程服务器的webservice没有任何问题,他调用我的也没问题。但是放到服务器的IIS上的时候就报错。注释掉webservice的时候没问题。
错误代码如下,权限我全开了,是.net 2.0的。

Server Error in '/message' Application.
--------------------------------------------

An existing connection was forcibly closed by the remote host 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host


大家帮我看看到底是怎么回事啊

------解决方案--------------------
一个现有的连接被远程主机强制关闭!google
------解决方案--------------------
ws有错误没捕捉吧。看日志。
------解决方案--------------------
低版本的NET 無法使用 HTTP GET 或 HTTP POST 來叫用 Web 服務的應用程式就會失敗

需要在webservice的web.config裡面加入下列的設定:
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
這樣就不會發生Internal Server Error的問題了!! 

------解决方案--------------------
  相关解决方案