I wrote the below code to process the soap xml response using jquery, but, jQuery is unable to read the response. Is there any syntax error I made in the below code? I don't see any errors in the console. Is there anything wrong in the soap message format or the way I am reading it?
I am a bit new to this kind of implementation.
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://code.jquery.com/jquery-1.7.2.min.js"> </script>
<script>
var xml = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://siebel.com/WebService">\
<soapenv:Header/>\
<soapenv:Body>\
<web:UpdateWO_Input>\
<web:Comments>?</web:Comments>\
<web:WOStatus>?</web:WOStatus>\
<web:WONum>?</web:WONum>\
</web:UpdateWO_Input><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://siebel.com/WebService">\
<soapenv:Header/>\
<soapenv:Body>\
<web:UpdateWO_Input>\
<web:Comments>?</web:Comments>\
<web:WOStatus>?</web:WOStatus>\
<web:WONum>?</web:WONum>\
</web:UpdateWO_Input>\
</soapenv:Body>\
</soapenv:Envelope>\
</soapenv:Body>\
</soapenv:Envelope> '
var myObj=new Array();
var index = 0;
$(document).ready(function(){
$(xml)
.find('UpdateWO_Input').find('Comments')
.each(function(){
myObj[index] = $(this).text();
index +=1;
});
for(var i =0; i< myObj.length;i++){
$('body').append(myObj[i]+"<br/>");
}
});
</script>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"> </script>
<![endif]-->
<style>
article, aside, figure, footer, header, hgroup,
menu, nav, section { display: block; }
</style>
</head>
<body>