locked
Unable to make object of WCF enabled service RRS feed

  • Question

  • User-1547279409 posted

    aspx:

     function GetData() {

                var proxy = new MyService();  // MOST OF THE TIME IT IS GIVING ERROR OF UNDEFINE BUT IS RUN ALSO SOMETIMES

                proxy.GetData(onSuccess);

            }

            function onSuccess(result) {

                alert(result);

            }


            $(document).ready(function () {


                // GetData();


            });  // End



        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
            <Services>
                <asp:ServiceReference Path="~/Dashboard.svc" />
            </Services>
        </asp:ScriptManager>
        <div>
            <input id="btnCallWCF" type="button" value="Client" onclick="return GetData()" />
        </div>
        </form>
    </body>
    </html>

    WCF Service Method:

    <OperationContract()>
        Public Function GetData() As String
            Return "127, 254, 124, 251"
        End Function

    Tuesday, June 4, 2013 6:33 AM