Consume SOAP webservice using jQuery
I have a SOAP web service in Java which needs to be called from an HTML page using jQuery.开发者_开发知识库 Can somebody tell me how to do that? I am new to it.
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.
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
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
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' /> <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.
精彩评论