JQuery ajax call to a web service and the parsing of the xml that is returned
$.ajax({
//url: "http://localhost:56257/CQWeb.asmx/GetSalesItemInfo",
url: "http://report.opwglobal.com:1026/WebCQWebService/CQWeb.asmx/GetSalesItemInfo",
data: strData,
dataType: "xml",
type: "POST",
success: function (data, status, req) {
//alert(req.responseText);
var xmlDoc = $.parseXML(req.responseText);
var $xml = $(xmlDoc);
var $si = $xml.find("SalesOrderItem");
$($si).each(function (index) {
var tr = '<tr><td>';
tr += $(this).find("PartNumber").text() + '<br/>';
tr += $(this).find("DESCRIPTION").text() + '<br/>';
tr += 'Sales Order: ' + $(this).find("OrderNumber").text() + '-';
tr += $(this).find("OrderLineNumber").text() + '<br/>';
tr += 'Customer PO: ' + $(this).find("PONumber").text() + '<br/>';
var $sis = $(this).find("SerialNumber");//SerialNumber
if ($sis.length > 0)
tr += '<table><tr><td valign="top">Serial Numbers: </td><td>';
$($sis).each(function (index) {
tr += $(this).text() + '<br/>';
});
if ($sis.length > 0)
tr += '</td></tr></table><br/>';
var $sin = $(this).find("Note");//Notes
$($sin).each(function (index) {
tr += $(this).text() + '<br/>';
});
tr += '</td><td valign="top">';
tr += $(this).find("OrderedQTY").text()
tr += '</td><td valign="top">';
tr += $(this).find("PRIMARY_UNIT_OF_MEASURE").text()
tr += '</td><td valign="top">';
tr += $(this).find("SHIPPED_QUANTITY").text()
tr += '</td><td valign="top">';
tr += $(this).find("BackOrderQty").text()
tr += '</td></tr>';
$("#dTable").append(tr);
});
},
error: function (a, b, c,d) {
alert('An error has occured, pleas contact thw website administrator');
}
});