Amit Tiwari

Amit Tiwari

  • NA
  • 2.7k
  • 1.2m

How can i call the WCF service using Jquery or Javascript

Aug 3 2013 10:54 AM
i tried this code but it is not working 


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script src="Scripts/jquery-1.8.2.js"></script>
 <script src="http://localhost:3640/Service1.svc/js"></script>
 <script src="Scripts/WebForms/MSAjax/MicrosoftAjax.js" type="text/javascript"></script>
   <script type="text/javascript">
        $(function () {        
            $("#btnCallService").click(
                function () {
                    CalWCF();
                });
        });


        function CalWCF() {
            var service = new IService1();
            service.GetData($("#txtName").val(),
                function (result) {
                    $("#dvMessage").html(result);
                });
        }
    </script>
    <title></title>
</head>

Answers (1)