08-18-2009 09:08 AM - edited 08-18-2009 09:10 AM
I am developing an HTML application using LabVIEW Web Services in version 8.6. I configured a VI to output data as XML. I am using the jQuery framework for javacript at this time. I noticed that when I try to get the data from this VI as XML jQuery won't load load it (might be having the same issue with prototype). After running a packet capture this is what I found the data from LabVIEW to look like:
HTTP/1.1 200 OK
Date: Tue, 18 Aug 2009 13:55:03 GMT
Server: Mbedthis-Appweb/2.3.0
Cache-Control: no-cache
Content-type: text/xml
Content-length: 87
Connection: keep-alive
Keep-Alive: timeout=60000, max=98
<Response><Terminal><Name>read_buffer</Name><Value>13.509</Value></Terminal></Response>
So it seems that the <?xml version="1.0"> tag at the top of the document is not being sent out and I have to add this manually to my javascript code before it works. Is there anyway to force LabVIEW to send this out on the server side? My javascript code:
<script type="text/javascript" src="js/jquery.js"></script>
<script>
$(document).ready(function(){
$.get("../LambdaWeb/lambda/read_volts", null, function(data){
var xml = $('<?xml version="1.0" ?>' + data);
alert("Data Loaded:" + xml);
}, "xml");
});
</script>
Also on a side note. I know that JSON is now available in LabVIEW 2009; is there anyway to get JSON support for 8.6?