Web Service method name is not valid

后端 未结 8 2870
余生分开走
余生分开走 2021-02-20 04:39

I get the following error \"Web Service method name is not valid\" when i try to call webmethod from javascript

System.InvalidOperationException: SaveBO

8条回答
  •  南笙
    南笙 (楼主)
    2021-02-20 05:05

    I too faced the similar issue. The solution includes checking everything related to ensuring all name, parameters are passed correctly as many have responded. Make sure that the web method name that we are calling in UI page is spelled correctly, the data, data types are correct and etc. In my case, I misspelled the web method name in my ajax call. It works fine once I found and corrected the name correctly.
    For Ex: In .asmx class file, this is the method name "IsLeaseMentorExistWithTheSameName" but when I called from UI this is how I called:

    var varURL = <%=Page.ResolveUrl("~/Main/BuildCriteria.asmx") %> + '/IsLeaseMentorExistWithSameName';  
    

    Notice that the word "The" is missing. That was a mistake and I corrected and so it worked fine.

提交回复
热议问题