issue : webservice is undefined

Last post 10-31-2008 1:40 AM by Vince Xu - MSFT. 2 replies.

Sort Posts:

  • issue : webservice is undefined

    10-29-2008, 2:18 AM
    • Member
      39 point Member
    • vaibhavgangal
    • Member since 09-25-2007, 8:27 AM
    • Mumbai
    • Posts 32

    Hi,

    VS2005, .net fmw 2.0

    I am not able to call webservice method from javascript.

    First it gave  GetJobs is undefined error. Then I added namespace to it as I am having web application project and not web site.

    Now it gives  nsGetjobs is undefined error.

    Please let me know what I am missing.

    Following is my code.

    ........

    setInterval("nsGetjobs.GetJobs.cBindGrid(updateGrid)", 10000);

    ........

    <asp:ScriptManager ID="sc1" runat="server">
            <Services>
                <asp:ServiceReference Path="GetJobs.asmx" />
            </Services>
        </asp:ScriptManager>

    .......

    Imports System.Web.Services
    Imports System.Web.Services.Protocols
    Imports System.ComponentModel
    Imports System.Web.Script.Services

    Namespace nsGetjobs

        <System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
        <System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
        <ToolboxItem(False)> _
        <ScriptService()> _
        Public Class GetJobs
            Inherits System.Web.Services.WebService

     <WebMethod()> _
            Public Function cBindGrid(ByVal s_param As String) As List(Of GridJobs)

      .....

     

    Thanks & Regards,

    Vaibhav

  • Re: issue : webservice is undefined

    10-29-2008, 9:24 AM
    • Contributor
      5,082 point Contributor
    • mrmercury
    • Member since 04-04-2006, 6:26 PM
    • Mexico City, Mexico
    • Posts 739
    I’m not sure you can call the WebService directly from setInterval try using a function that in turn calls the webservice.
    If this post helped you please remember to set it as Answer so it can help others.
  • Re: issue : webservice is undefined

    10-31-2008, 1:40 AM
    Answer

    Hi,

    If you define the namesapce in webservice, please define the related class for asmx file.

    <%@ WebService Language="VB.NET" Class="nsGetjobs.GetJobs" %>

     


    Vince Xu
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (3 items)