Web Service method name is not valid

后端 未结 8 3022
余生分开走
余生分开走 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:06

    As Sundar Rajan states, check the parameters are also correct. My instance of this error was because I had failed to pass any parameters (as a body in a POST request) and the asmx web method was expecting a named parameter, because of this the binding logic failed to match up the request to the method name, even though the name itself is actually correct.

    [WebMethod]
            public object MyWebMethod(object parameter)
    

    If there is no parameter in the body of the request then you will get this error.

提交回复
热议问题