我正在嘗試對生產Web應用程序進行一些增強。經過相當多的在我的WinXP單元測試的IIS 5.1的開發機,一切工作在我的本地所以我使用了Visual Studio 2008的發佈我的開發PC上對話,推動以下項目臨時服務器:System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse請求失敗,HTTP狀態404
- 的主要的Web應用程序
- 「主」 web服務(主頁試圖調用這個WS)
- 「次要」 web服務(還不是一個問題,因爲主頁不調用此WS)
我得到以下結果g當我嘗試瀏覽到Web應用程序中輸入到這個瀏覽器的主頁:myUglyURL
Server Error in '/zVersion2' Application.
The request failed with HTTP status 404: Not Found.
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.WebException: The request failed with HTTP status 404: Not Found.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[WebException: The request failed with HTTP status 404: Not Found.]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +431289
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204
ProxyZipeeeService.WSZipeee.Zipeee.GetMessageByType(Int32 iMsgType) in C:\Documents and Settings\johna\My Documents\Visual Studio 2008\Projects\ProxyZipeeeService\ProxyZipeeeService\Web References\WSZipeee\Reference.vb:2168
Zipeee.frmZipeee.LoadMessage() in C:\Documents and Settings\johna\My Documents\Visual Studio 2008\Projects\Zipeee\frmZipeee.aspx.vb:43
Zipeee.frmZipeee.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\johna\My Documents\Visual Studio 2008\Projects\Zipeee\frmZipeee.aspx.vb:33
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
版本信息:Microsoft .NET Framework版本:2.0.50727.3607; ASP.NET版本:2.0.50727.3082
這裏是一個位對應的源代碼:
Public wsZipeee As New ProxyZipeeeService.WSZipeee.Zipeee
Dim dsStandardMsg As DataSet
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
LoadMessage()
End If
End Sub
Private Sub LoadMessage()
Dim iCnt As Integer
Dim iValue As Integer
dsStandardMsg = wsZipeee.GetMessageByType(BizConstants.MsgType.Standard)
End Sub
我懷疑我可能已經在臨時服務器上配置不正確的事情。登臺服務器是運行IIS 6.0的Win Server 2003 ServicePack 2。當我在名爲MOJITO的登臺服務器上發佈主站點和2個Web服務時,我爲D盤上的每個站點創建了物理目錄。然後使用INETMGR,我配置了以下虛擬目錄:
- zVersion2
- zVersion2wsSQL
- zVersion2wsEmergency
上述所有配置爲使用新的應用程序池我的設置和命名zVersion2aspNet20。本機的默認網站MOJITO配置爲使用ASP.NET 1.1,IP地址設置爲(全部未分配)。後兩種web服務的生產版本在MOJITO機器上運行(分別命名爲ZipeeeService和EmergencyService)。
我的上述web服務(分別命名爲zVersion2wsSQL和zVersion2wsEmergency)的暫存版本可以共存於具有相同IP地址的同一臺Web服務器上嗎?
請注意,當我獨立測試zVersion2wsSQL web服務(從INETMGR鼠標右鍵,然後單擊Browse),它按預期工作(即呈現web服務的所有方法),這樣的片段:
- GetMessageByType MessageName =「Get_x0020_Message_x0020_By_x0020_Type」
我可以通過點擊測試此的WebMethod,並給出了測試對話框(因爲它需要一個簡單的數據類型,我調用它在本地主機(即MOJITO):
**Get Message By Type**
**Test**
To test the operation using the HTTP POST protocol, click the 'Invoke' button.
Parameter Value
iMsgType: _______ [INVOKE button]
SOAP 1.1 ....etc.
我擔心我可能已經有太多的信息,天馬行空,所以我會停止,但我希望有人能幫助我,我不明白爲什麼這個請求的結果是「未找到」。謝謝。
是的,他們很有用,謝謝。虛擬目錄是一個真正的痛苦= / – Francisco 2015-06-16 15:34:02