如何使用Java脚本来消费由Windows服务承载WCF服务 [英] how to consume wcf service hosted by windows service using java script

查看:104
本文介绍了如何使用Java脚本来消费由Windows服务承载WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不得不使用Windows服务和服务的托管已顺利完成,现在我的需求量的就是消耗它的JavaScript和服务收益表中的WCF服务托管,这是XML格式的列名标签会这样如何阅读日期为

Hi i had a wcf service hosted using windows service and the hosting of service was successfully completed and now my requirment is to consume it in javascript and the service returns table and it was in xml format with column names as tags in it so how to read date in it

推荐答案

我已经得到了答案这里是code用JavaScript编写的

I had got the answer Here is the code written in javascript

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script type="text/javascript">
        window.onload = invokeService();
        function invokeService() {
            $(document).ready(function () {


                //   Additional way of calling WCF service using getJSON() JQuery method
                $.getJSON("http://localhost/WcfJsonRestService/Albums/rjinfo", {},
                    function (data) {
                         alert("hello " + data);

                    });
            });
            }


    </script>

这篇关于如何使用Java脚本来消费由Windows服务承载WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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