AutoCompleteExtender 不适用于 IIS 7 上托管的 WebService

发布于 2024-09-17 21:59:13 字数 236 浏览 12 评论 0原文

我的项目中有一个 Web 服务文件,其中有一个用于 AutoCompleteExtender 的 Web 方法,当我从 VS 调试它时,该文件工作正常。

但是当我在 IIS 上发布并托管它时,它无法正常工作。

不过,我直接通过键入 URL 来测试 Web 服务方法,它给出了所需的输出。

是否需要在 IIS 中进行特殊设置才能使其正常工作,或者需要设置 AutoCompleteExtender 的任何属性吗?

I have a web service file in my project having a web method which is used for AutoCompleteExtender and which works fine when I debug it from VS.

But when I publish and host it on IIS, it's not working properly.

However, I tested the webservice method directly by typing the URL and it gave the desired output.

Is their a special setting needs to be done in IIS to make it working or any property of AutoCompleteExtender need to be set?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

孤星 2024-09-24 21:59:13

当我将站点从 cassini 移动到 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>

I had this issue as I moved a site from cassini to IIS7.5. After a lot of digging had to add the follwoing to the web.config in the system.webServer section. Hope it helps.

<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>
菩提树下叶撕阳。 2024-09-24 21:59:13

从 ASP.NET 3.5 升级到 4.0 后,我遇到了同样的问题,无法让扩展程序工作。从 firefox 和 firebug 中,我收到 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 但收到配置错误。

After a upgrade from ASP.NET 3.5 to 4.0 I have the same problem and can't get the extender to work. From firefox and firebug I recive a 500 Internal Server Error with the message

System.InvalidOperationException: Request format is invalid: application/json; charset=utf-8.
at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

I have tested with the web.config settings suggested by http://msdn.microsoft.com/en-us/library/bb763183.aspx but recive configuration errors.

孤凫 2024-09-24 21:59:13

尝试更改处理程序的顺序(删除然后添加)。在此示例中,我删除了除 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> 

Try changing the order of the handlers (remove then add). In this example I have removed all but the AJAX/script handler.

<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> 
吐个泡泡 2024-09-24 21:59:13

不是IIS或者ath的问题。它实际上是一个错误(我认为)。在 Web 服务中返回字符串数组的函数中,请检查函数的参数名称或参数。
字符串参数的名称必须是 prefixText,int 字段的名称必须是 count。

并且你的webservice中的函数必须有这两个参数。

像这样

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

Its not the problem of IIS or ath. Its a bug actually (I think). In your function in webservice to return the string array please check the parameter names or arguments to the function.
The name of the string parameter must be prefixText and that of int field should be count.

And there must be these two parameters for your functions in the webservice.

like this

[WebMethod]
  public string[] getCountry(string prefixText, int count)
    {
        ......
....
return ...
    }
贱人配狗天长地久 2024-09-24 21:59:13

我面临着同样的问题。在 IIS 7 Windows Server 2008 R2 中托管后,AutoCompleteExtender 无法工作。

通过将应用程序池的“托管管道模式”从“集成”更改为“经典”对我有用。
这个设置可以通过选择应用程序池->应用程序池来进行。选择基本设置。

谢谢。

I was facing the same problem. AutoCompleteExtender was not working after hosting in IIS 7 Windows Server 2008 R2.

By changing the "Managed Pipeline Mode" of Application Pool from "integrated" to "Classic" worked for me.
This setting can be taken by selecting the application pool -> select Basic setting.

Thank you.

南城追梦 2024-09-24 21:59:13

尝试...

转到开始>运行>inetmgr>

在连接侧窗格中..选择应用程序池,

选择您在将该项目部署到 iis 时分配的应用程序池(要检查是否转到连接窗格中的站点>...并右键单击您已部署的网站并选择管理网站>高级设置,然后在顶部您将能够看到应用程序池)

然后返回并在连接窗格的应用程序池中选择特定的应用程序池
右键单击该特定应用程序池并选择高级设置..找出其中的进程模型并选择身份并浏览它并转到内置帐户并选择本地系统.......然后单击确定...并获取出了它......

我认为它会起作用......它对我有用......

Try...this

go to start>run>inetmgr>

In the connections sidepane..select application pools

select the application pool that u hav assigned when deployed that project into iis(to check that go to sites>in connections pane...and right click on website that u have deployed and select manage website >advanced settings then at the top u wil able to see application pool)

then comeback and select that particular application pool in application pools in connections pane
right click on that particular application pool and select advanced settings..find out process model in that and select identity and browse through it and goto built in account and select local system.......then click ok...and get out of it...

I think it will work..it worked for me.....

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文