我如何使用 android 的phonegap 调用网络服务

发布于 2024-12-06 06:14:04 字数 317 浏览 1 评论 0原文

如何从我的 PhoneGap 应用程序发起 Web 服务调用?我发现了两个 javascript 库,一个来自 IBM,另一个来自 IvanWebService http://wiki。 phonegap.com/w/page/43725416/SOAP%20Web%20Service 允许您进行此类调用,但我无法让它们运行我的任何网络服务。我正在传递一个 wsdl 链接作为服务链接,并且我已经更新了信封参数,但仍然没有任何内容。

How do I make a webservice call from my phonegap app? I found two javascript libraries one from IBM and another IvanWebService http://wiki.phonegap.com/w/page/43725416/SOAP%20Web%20Service that allow you to make such calls but i couldnt get them to run any of my webservices. I am passing in a wsdl link as the service link and i have updated the envelope parameters, still nothing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

花落人断肠 2024-12-13 06:14:04
<head>

    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" />
<script src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script>

<script type="text/javascript">
        $(function() {

            $("#requestXML").click(function() {

                     $.ajax({
                      type: "POST",
                      url: "http://YOURSITE/script.php",
                      data: "{}",
                      cache: false,
                      dataType: "xml",
                      success: onSuccess
                    });

            });

            $("#resultLog").ajaxError(function(event, request, settings, exception) {
              $("#resultLog").html("Error Calling: " + settings.url + "<br />HTTP Code: " + request.status);
            });

             function onSuccess(data)
              {   alert(data);
               }


        });

        </script>

</head>

调用上述方法的按钮:

<input id="requestXML" type="button" value="Request XML" />
<head>

    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" />
<script src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script>

<script type="text/javascript">
        $(function() {

            $("#requestXML").click(function() {

                     $.ajax({
                      type: "POST",
                      url: "http://YOURSITE/script.php",
                      data: "{}",
                      cache: false,
                      dataType: "xml",
                      success: onSuccess
                    });

            });

            $("#resultLog").ajaxError(function(event, request, settings, exception) {
              $("#resultLog").html("Error Calling: " + settings.url + "<br />HTTP Code: " + request.status);
            });

             function onSuccess(data)
              {   alert(data);
               }


        });

        </script>

</head>

Button to call the above method:

<input id="requestXML" type="button" value="Request XML" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文