webservice - 未知的web方法参数名称methodname [英] webservice - unknown web method parameter name methodname

查看:1375
本文介绍了webservice - 未知的web方法参数名称methodname的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我调用了一个webservice来获取fullcalendar中的项目。
这个方法永远不会被调用,并且萤火虫会发出以下错误:

* POST [http]:// localhost:50536 / FullCalendar / ServicioFullCalendar.asmx / GetEventosCalendario
POST [http:// localhost:50536 / FullCalendar / ServicioFullCalendar.asmx / GetEventosCalendario



500内部服务器错误
1.01s
未知web方法参数名称methodname*



以下是asmx.vb代码:

 < System.Web.Script.Services.ScriptService()> _ 
< System.Web.Services.WebService(Namespace:=http:// localhost / uva /)> _
< System.Web.Services.WebServiceBinding(ConformsTo:= WsiProfiles.BasicProfile1_1)> _
< ToolboxItem(False)> _
公共类ServicioFullCalendar
继承System.Web.Services.WebService

< ScriptMethod(ResponseFormat:= ResponseFormat.Json)> _
< WebMethod(MessageName:=ObtieneEventos)> _
Public Shared Function GetEventosCalendario(ByVal startDate As String,ByVal endDate As String)As String
Try
返回CalendarioMensualDAO.Instance.getEventos(startDate,endDate)

捕捉到异常
抛出新异常(FullCalendar:GetEventos:& ex.Message)
最后

结束尝试
结束函数

webservice从fullcalendar加载,如下所示:

  events:ServicioFullCalendar.asmx / GetEventosCalendario,


解决方案

这是错误的:该方法必须是不共享,并且没有消息名称:

 < ScriptMethod(ResponseFormat:= ResponseFormat.Json)GT; _ 
< WebMethod()> _
Public Function GetEventosCalendario(ByVal startDate As String,ByVal endDate As String)As String
Try
返回CalendarioMensualDAO.Instance.getEventos(startDate,endDate)

Catch ex例外
抛出新的异常(FullCalendar:getEventos:& ex.Message)
最后

结束尝试
结束函数


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

*"POST [http]://localhost:50536/FullCalendar/ServicioFullCalendar.asmx/GetEventosCalendario POST [http]://localhost:50536/FullCalendar/ServicioFullCalendar.asmx/GetEventosCalendario

500 Internal Server Error 1.01s" "unknown web method parameter name methodname"*

Here is the asmx.vb code:

    <System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http://localhost/uva/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class ServicioFullCalendar
    Inherits System.Web.Services.WebService

    <ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _
    <WebMethod(MessageName:="ObtieneEventos")> _
    Public Shared 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

The webservice is "loaded" from the fullcalendar as follows:

events: "ServicioFullCalendar.asmx/GetEventosCalendario",

解决方案

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

这篇关于webservice - 未知的web方法参数名称methodname的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆