webservice - unknown web method parameter name methodname

后端 未结 3 551
小鲜肉
小鲜肉 2021-01-19 15:10

I called a webservice for fetching items in fullcalendar. The method is never called and firebug gives this error:

*\"POST [http]://localhost:50536/FullCal

相关标签:
3条回答
  • 2021-01-19 15:26

    I recommend you use Fiddler to look at the network traffic and see what's being sent to the service. Then figure out why it's being sent that way.

    It seems likely that you really are somehow sending a parameter named "methodname".

    0 讨论(0)
  • 2021-01-19 15:28

    I had the same problem and after spending a lot of time realized that the method was marked as protected and not PUBLIC. I made it public and it started working.

    0 讨论(0)
  • 2021-01-19 15:38

    That was the mistake: the method had to be "not Shared", and without the "Messagename":

    <ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _
    <WebMethod()> _
    Public Function GetEventosCalendario(ByVal startDate As String, ByVal endDate As String) As String
        Try
            Return CalendarioMensualDAO.Instance.getEventos(startDate, endDate)
    
        Catch ex As Exception
            Throw New Exception("FullCalendar:getEventos: " & ex.Message)
        Finally
    
        End Try
    End Function
    
    0 讨论(0)
提交回复
热议问题