無論何時我嘗試執行System.Net.HttpWebRequest.GetRequestStream(),無論我撥打什麼URL,都會收到以下錯誤:Asp.Net錯誤:無法建立連接,因爲目標機器主動拒絕它
Exception Type: System.Net.WebException
Message: Unable to connect to the remote server
Source: System
Stack Trace:
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at WorldVision.Sitefinity.Data.Business.WebServices.Viocorp.PreparePostRequest(WebRequest webRequest, NameValueCollection parameters) in c:\Inetpub\Websites\WvaFEGit\CmsWebsite\WorldVision.Sitefinity.Data\Business\WebServices\Viocorp.cs:line 167
at WorldVision.Sitefinity.Data.Business.WebServices.Viocorp.QueryWithParameters(ServiceType service, NameValueCollection parameters) in c:\Inetpub\Websites\WvaFEGit\CmsWebsite\WorldVision.Sitefinity.Data\Business\WebServices\Viocorp.cs:line 109
at WorldVision.Sitefinity.Data.Business.WebServices.Viocorp.QueryWithParameters(String serviceName, NameValueCollection parameters) in c:\Inetpub\Websites\WvaFEGit\CmsWebsite\WorldVision.Sitefinity.Data\Business\WebServices\Viocorp.cs:line 87
at WorldVision.Sitefinity.Data.Business.VioCorpVideoRepository.GetVideoByMediaId(String mediaId) in c:\Inetpub\Websites\WvaFEGit\CmsWebsite\WorldVision.Sitefinity.Data\Business\IVioCorpVideoRepository.cs:line 28
at WorldVision.Sitefinity.Modules.Story.WebControls.Design.VioCorpVideoControlDesigner.BindPresentation() in c:\Inetpub\Websites\WvaFEGit\CmsWebsite\WorldVision.Sitefinity.Modules\Story\WebControls\Design\VioCorpVideoControlDesigner.cs:line 143
at WorldVision.Sitefinity.Modules.Story.WebControls.Design.VioCorpVideoControlDesigner.BindVideo() in c:\Inetpub\Websites\WvaFEGit\CmsWebsite\WorldVision.Sitefinity.Modules\Story\WebControls\Design\VioCorpVideoControlDesigner.cs:line 136
at WorldVision.Sitefinity.Modules.Story.WebControls.Design.VioCorpVideoControlDesigner.Button_Command(Object sender, CommandEventArgs e) in c:\Inetpub\Websites\WvaFEGit\CmsWebsite\WorldVision.Sitefinity.Modules\Story\WebControls\Design\VioCorpVideoControlDesigner.cs:line 187
at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
------------------------------------------------------------------------------------
- L1 -------------------------------------------------------------------------------
Exception Type: System.Net.Sockets.SocketException
Message: No connection could be made because the target machine actively refused it 210.247.216.66:80
Source: System
Stack Trace:
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)
------------------------------------------------------------------------------------
我看了兩個不同的提供者的兩個不同的Url和我得到完全相同的錯誤,除了IP地址是不同的。
我檢查了防火牆設置,IIS設置和服務器設置,沒有什麼突出的。
更糟糕的是,代碼在使用IIS 7.5的外部服務器上工作,但配置相同,但在內部服務器上失敗。
我也有內部IP地址添加到兩個提供者的接受列表。
因此,該代碼工作良好的外部而不是內部。無論代碼如何,都沒有任何區別。
任何想法?
任何代碼示例? – 2011-05-23 06:11:09
更好的serverfault可能? – 2011-05-23 06:49:50