当前位置: 代码迷 >> Web Service >> 調用WebService出錯。该如何处理
  详细解决方案

調用WebService出錯。该如何处理

热度:293   发布时间:2016-05-02 03:07:05.0
調用WebService出錯。
現在有兩個程序都需要兩個WebService。兩個WebService的代碼差不多。
但有一個程序就經常會遇到如下的情況,而另一個就不會。

System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted 127.0.0.1:1979 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetRequestStream() at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at DBSelect.DBSelect.GetActiveCriteria(String AppraisalNo, String company, String cost_center, String Badge) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\qprs\37813ce2\f483149b\App_WebReferences.vzuemjtn.2.cs:line 2694 at clsPdfData.PaddingData(DataSet ds1, String strAppNo, String badge, Int32 intCount, DataTable dtHistory) in c:\Documents and Settings\amswychung\My Documents\SourceCode\QPRS\App_Code\clsPdfData.cs:line 47 at clsPdfData.printPDF(DataTable dtGroup, Int32 group, String[]& filelist, String prefix, String Remark) in c:\Documents and Settings\amswychung\My Documents\SourceCode\QPRS\App_Code\clsPdfData.cs:line 400 System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted 127.0.0.1:1979 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetRequestStream() at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at DBSelect.DBSelect.GetWorkDesc(String AppraisalNo, String Badge, String Company) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\qprs\37813ce2\f483149b\App_WebReferences.vzuemjtn.2.cs:line 2745 at clsPdfData.printPDF(DataTable dtGroup, Int32 group, String[]& filelist, String prefix, String Remark) in c:\Documents and Settings\amswychung\My Documents\SourceCode\QPRS\App_Code\clsPdfData.cs:line 209 System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted 127.0.0.1:1979 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetRequestStream() at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at DBSelect.DBSelect.GetWorkDesc(String AppraisalNo, String Badge, String Company) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\qprs\37813ce2\f483149b\App_WebReferences.vzuemjtn.2.cs:line 2745 at clsPdfData.printPDF(DataTable dtGroup, Int32 group, String[]& filelist, String prefix, String Remark) in c:\Documents and Settings\amswychung\My Documents\SourceCode\QPRS\App_Code\clsPdfData.cs:line 209


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