我開發了一個使用web服務的web應用程序。在開發環境中一切正常。我已將Web服務移至我主網站後面的測試文件夾中的生產服務器。我可以瀏覽到生產服務器上已發佈的本地服務,並且可以從我的開發機器訪問遠程服務。拒絕Web服務連接
如果我在我的開發環境中運行我的web應用程序,我可以使用遠程webservice沒有問題。如果我將Web應用程序移動到生產環境,則在應用程序執行ajax登錄方法時,瀏覽器輸出此錯誤。
下面的JavaScript錯誤是輸出到瀏覽器
Error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server.
The status code returned from the server was: 500
Source File: www.grav80.com/clients/callswharf/Redshift/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1247b7d8-6b6c-419f-a45f-8ff264c90734%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.2.826.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3ad2d891f5-3533-469c-b9a2-ac7d16eb23ff%3a16e4e7cd%3a86526ba7%3aed16cbdc%3ab7778d6c
Line: 15
出現在事件下面的錯誤日誌
Exception information:
Exception type: WebException
Exception message: Unable to connect to the remote server
Request information:
Request URL: www.grav80.com/clients/callswharf/redshift/login.aspx
Request path: /clients/callswharf/redshift/login.aspx
User host address: 77.68.58.231
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
您可以查看在測試環境在這裏的行爲。 http://www.grav80.com/clients/callswharf/redshift/
您可以查看這裏的服務 http://www.grav80.com/clients/callswharf/redshift/service/g80cms.asmx
我希望一些對可照一些輕這對我來說。
嗨,John,感謝您的快速回復。 Login.aspx對web服務進行ajax調用。 Wen即時通過開發機器連接到現場服務,只要將應用程序移至實時環境中,它就可以正常工作。 據我所知,使用webresources.axd購買頁面上的telerik控件。這個javascript錯誤只發生在ajax回發之後。 – sidcom 2010-03-31 02:22:51
@sidcom:當你說「AJAX」時,你是從客戶端(在瀏覽器中)還是從服務器(在login.aspx.cs中)使用它? – 2010-03-31 02:32:18
嗨,John我正在使用telerik Rad Ajax Panel來「ajaxify」登錄區域。 ajax面板將所有基於服務器的事件轉換爲ajax請求。在login.aspx.cs中執行的代碼連接到web服務並檢查用戶是否使用了正確的登錄信息。如果用戶無法登錄,則不會進行可見的頁面刷新並顯示客戶端錯誤消息。如果用戶可以登錄,則創建會話並將用戶定向到控制面板主頁。希望有所幫助。 – sidcom 2010-03-31 03:11:05