Skip to content Skip to sidebar Skip to footer

Cannot Extract Soap Xml With Jquery

I'm using jQuery to extract SOAP XML data from an AJAX response using the following code inside the success callback. I'm using the example from https://api.jquery.com/jQuery.parse

Solution 1:

Adding the namespace with \\: appended fixed the issue. The following callback works on both Chrome, Firefox & IE. However, it does not work on Edge. Edge only works when no namespace is specified.

success: function(data) {
  var $xml = $( data );
  if ($xml.find("ax25\\:error").text() != "") {
    resetUI();
    alertMessage($xml.find("ax25\\:error").text(), "danger");
  } else {
    curShipment.labelId = $xml.find("ax27\\:id").first().text();
    curShipment.loo_wb = $xml.find('ax27\\:value').first().text();
    curShipment.senderName = $xml.find('ax27\\:pickup_name').text();
    curShipment.consigneeName = $xml.find('ax27\\:delivery_name').text();
    saveShipment();
  }

Post a Comment for "Cannot Extract Soap Xml With Jquery"