开发者

AutoCompleteExtender not working for WebService hosted on IIS 7

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 metho开发者_如何学JAVAd 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?


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>


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.


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> 


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 ...
    }


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.


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.....

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜