consume SOAP webservice using jquery

[亡魂溺海] 提交于 2019-12-18 13:26:49

问题


I have a SOAP web service in java which needs to ba called from an html page using jquery. Can somebody tell me how to do that. I am new to it.


回答1:


A quick google search reveals that there is a jquery plugin for this:

http://plugins.jquery.com/project/jqSOAPClient

Download, examples and further information available from this link.




回答2:


there is a relatively new plugin available:

http://plugins.jquery.com/soap/

I forked the project, and have been working on some modifications (the plugin did not handle the service I was working with). I hope to get my updates merged at some point, but would be happy to have any feedback.

https://github.com/zachofalltrades/jquery.soap




回答3:


Hey here is the link You can go through this for more simple usage.

http://www.andrewrowland.com/article/display/consume-dot-net-web-service-with-jquery

Make this answer if it solves ur problem.

Thank You




回答4:


ya you can do it by this way as bellow.

$(document).ready(function() {
    $('input:button').addClass("btnClass");
    fillData();
    $('#btnGet').click(function() {
        fillData();
    });
    function fillData() {
        $.ajax({
            type: "Post",
            url: "../myService.asmx/getStudent",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function(msg) {
                //var nMsg = (typeof msg.d) == 'string' ? eval('(' + msg.d + ')') : msg.d;
                var t = "<table width='80%' id='resTab'> <tr>" +
                      "<td colspan='5' style='text-align:center'><font size='3'><strong>Your Search Result......</strong></font></td></tr> <tr><td style='text-align:left' colspan='5'><hr></td></tr> "
                      + " <tr><td style='text-align:center'>Student ID</td><td style='text-align:center'>Student Name</td><td style='text-align:center'>Student Course</td><td style='text-align:center'>Student USN</td></tr>"
                      + " <tr><td style='text-align:left' colspan='5'><hr><br></td></tr> ";
                $.each(msg.d, function(index, item) {
                t = t + " <tr><td style='text-align:center'>" + item.studId + "</td><td style='text-align:center'>" + item.studName + "</td><td style='text-align:center'>" + item.studCourse + "</td><td style='text-align:center'>" + item.studUsn + "</td><td><input type='button' ID='btn-" + item.studId + "' value='Delete' class='new-button' />&nbsp;&nbsp;&nbsp;<input type='button' ID='upd-" + item.studId + "' value='Update' class='upd-button' /></td></tr>";
                    t = t + " <tr><td style='text-align:left' colspan='5'><hr></td></tr> ";
                });
                t = t + " </table> ";
                $("#stdData").html(t);
            },
            error: function(msg) { }
        });
    }

Here I am showing the data into a div ............

so Reply me if it solved and if any query ping me.



来源:https://stackoverflow.com/questions/3787309/consume-soap-webservice-using-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!