2010-09-03 46 views
2

我的項目中有一個Web服務文件,它有一個用於AutoCompleteExtender的Web方法,當我從VS進行調試時它工作正常。AutoCompleteExtender不適用於託管在IIS 7上的WebService

但是,當我在IIS上發佈和託管它時,它無法正常工作。

但是,我通過輸入URL直接測試了webservice方法,並給出了所需的輸出。

是否需要在IIS中完成特殊設置才能使其工作或需要設置AutoCompleteExtender的任何屬性?

回答

0

從ASP.NET 3.5升級到4.0後,我有同樣的問題,無法讓擴展器工作。從firefox和螢火蟲我收回500內部服務器錯誤與消息

System.InvalidOperationException:請求格式無效:application/json;字符集= UTF-8。 在System.Web.Services.Protocols.HttpServerProtocol.ReadParameters() 在System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

我與由http://msdn.microsoft.com/en-us/library/bb763183.aspx但recive配置建議的web.config設置測試錯誤。

0

嘗試更改處理程序的順序(刪除然後添加)。在這個例子中,我除去了AJAX /腳本處理程序。

<system.webServer> 
    <modules runAllManagedModulesForAllRequests="true" /> 
    <handlers> 
    <remove name="WebServiceHandlerFactory-Integrated"/> 
    <remove name="WebServiceHandlerFactory-ISAPI-2.0"/> 
    <remove name="WebServiceHandlerFactory-ISAPI-2.0-64"/> 
    <remove name="WebServiceHandlerFactory-ISAPI-4.0_32bit"/> 
    <remove name="WebServiceHandlerFactory-ISAPI-4.0_64bit"/> 
    <!--<add name="WebServiceHandlerFactory-Integrated-4.0" ...</handlers> 
+0

不幸的是,這並沒有真正的幫助... – Abel 2010-12-30 16:21:04

0

它不是IIS或ath的問題。它實際上是一個錯誤(我認爲)。在webservice函數中返回字符串數組,請檢查函數的參數名稱或參數。 字符串參數的名稱必須是prefixText,int字段的名稱應該是count。

並且在web服務中必須有這兩個參數用於您的功能。

這樣

[WebMethod] 
    public string[] getCountry(string prefixText, int count) 
    { 
     ...... 
.... 
return ... 
    } 
1

我有這個問題,因爲我感動卡西尼號站點到IIS7.5。在大量的挖掘之後,必須將這些附加內容添加到system.webServer部分的web.config中。希望能幫助到你。

<modules runAllManagedModulesForAllRequests="true"> 
     <remove name="ScriptModule" /> 
     <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
    </modules> 

<handlers> 
    <remove name="ScriptHandlerFactory"/> 
    <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
</handlers> 
-1

嘗試...這

轉到開始>運行> INETMGR>

在連接sidepane..select應用程序池

選擇應用程序池ü甲肝分配時將該項目部署到iis中(檢查連接窗格中的網站>並右鍵單擊已部署的網站並選擇管理網站>高級設置,然後在頂部,我們將能夠看到應用程序池)

然後回滾並在連接窗格 中的應用程序池中選擇該特定應用程序池,然後右鍵單擊該特定應用程序池並選擇高級設置。找出該進程模型並選擇標識並瀏覽並轉到內置帳戶選擇本地系統.......然後點擊確定...並離開它...

我認爲它會工作..它爲我工作.....