Application.Unknown web method GetCompanyNames.

2 posts, 0 answers
  1. Michel
    Michel avatar
    2 posts
    Member since:
    Mar 2014

    Posted 19 Apr 2014 Link to this post

    Hi all,

    I am trying to use the component AutoCompleteBox with a local Webservice. But I got an issue.

    So I run Fiddler webdebug, and I can see an error 500, in the detail, I saw:

    POST http://localhost:49257/agent/Ws/_WS_SearchCity.asmx/GetCompanyNames HTTP/1.1
    Accept: */*
    X-Requested-With: XMLHttpRequest
    Content-Type: application/json; charset=utf-8
    Referer: http://localhost:49257/agent/AcquereurAction.aspx?aID=8&sID=2c0d3ed4-4d34-4ce0-b437-70cf387c56e2
    Accept-Language: fr-FR
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)
    Host: localhost:49257
    Content-Length: 122
    DNT: 1
    Connection: Keep-Alive
    Pragma: no-cache
    Cookie: ASP.NET_SessionId=pdwak0ep3ear4yj3nzsvv2ae

    {"context":{"Text":"puteaux","MaxResultCount":-1,"IsCaseSensitive":false,"ClientData":"ClientData_Passed_To_The_Service"}}



    And the detail is:

    Server Error in '/agent' Application.Unknown web method GetCompanyNames.
    Parameter name: methodName 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.ArgumentException: Unknown web method GetCompanyNames.
    Parameter name: methodName

    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: 

    [ArgumentException: Unknown web method GetCompanyNames.
    Parameter name: methodName]
    System.Web.Script.Services.WebServiceData.GetMethodData(String methodName) +216
    System.Web.Script.Services.RestHandler.CreateHandler(WebServiceData webServiceData, String methodName) +63
    System.Web.Script.Services.RestHandler.CreateHandler(HttpContext context) +298
    System.Web.Script.Services.RestHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +185
    System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +119
    System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +226
    System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +145
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155






    However, my code folow this sample


    http://www.telerik.com/help/aspnet-ajax/autocompletebox-databinding-webservice.html













  2. Michel
    Michel avatar
    2 posts
    Member since:
    Mar 2014

    Posted 19 Apr 2014 in reply to Michel Link to this post

    I just found out why.

    I remove STATIC from the code below, and now it works

    [WebMethod]

    public AutoCompleteBoxData GetCompanyNames(object context)

    {

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top