LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XMLHTTPRequest returns code, not data

When calling a VI for data using XMLHTTPRequest, the VI is supposed to run and return the data as the response.  What might be the problem if, instead of returning the response, the server returns the contents of the VI file?
0 Kudos
Message 1 of 5
(2,423 Views)

It appears that the VI is being served as static content (which I allow in the target properties, Web Server: Configuration | Allow Access).

 

The request header is:

Host10.1.13.50
User-AgentMozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)
Accepttext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Languageen-us,en;q=0.5
Accept-Encodinggzip,deflate
Accept-CharsetISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive115
Connectionkeep-alive
X-Requested-WithXMLHttpRequest
Refererhttp://10.1.13.50/user_interface.html

 

The response header is:

DateWed, 17 Mar 2010 19:45:50 GMT
ServerMbedthis-Appweb/2.3.0
Content-Typetext/plain
Last-ModifiedWed, 17 Mar 2010 19:40:58 GMT
Etag"17e-359b-4ba1304a"
Content-Length13723
Connectionkeep-alive
Keep-Alivetimeout=60000, max=8

 

The response is (truncated):

RSRC
LVINLBVW��1������� ��1����x`����� ��������<@������������������������C{J���˧F�n��� ������sL�T��H�2�llg���ُ��� ���B~��@��������0��ُ��� ���B~��?�l�1��4��v�"ѷ�W~|��e�J��g�������LVINXHR_handler.vi�������VIVI�����NI_InternetTK_Core_VIs.lvlibCGI Read Request.vi�PTH0���=���<vilib>addonsinternethttpcgi.llbCGI Read Request.vi������������������������VIVI����NI_InternetTK_Core_VIs.lvlib%CGI Parse URL-Encoded Param String.vi�PTH0���O���<vilib

 

The size of the response (in bytes) is the same size as the VI file on the target.

0 Kudos
Message 2 of 5
(2,418 Views)
More interesting than the request header would be the requested URL.
Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 5
(2,407 Views)

URL:  http://10.1.13.50/user_interface.html.  This loads the js file and the js file requests cgi-bin/XHR_handler.vi.

 

Target is cRIO-9074.

0 Kudos
Message 4 of 5
(2,404 Views)

Hello,

 

When you navigate to the website with a browser, are things fine? Or is this just happening when using the LabVIEW function to retreive the XML?

 

-Zach

0 Kudos
Message 5 of 5
(2,360 Views)