cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Web Service Error on Render ESP Template

SOLVED
John_Neutron
Member
Solved!

LabVIEW Web Service Error on Render ESP Template

Message contains an attachment

Hello

 

I was hoping people would be able to help with the following problem:

 

I am trying out the Embedded Server Page (ESP) scripting functionality of the LabVIEW webservices and keep receiveing an error when attempting to render a page.

 

I believe that I have set up the HTTP request handler correctly - buffered stream with headers

 

The correct template is located and used as the page renders upto the esp variable insertion point.

 

I find that the Address Book example works fine, except if I try and add an additional variable to the template, then the same error occurs.

 

I have attached an example project that displays the same behaviour and the error is below.

 

Tested on LabVIEW 2014 (14.0.1 SP1) 32 bit on 64 bit Windows 7.

 

Cheers

 

John

 

*****************************************************************************************************

 

Error -67035 occurred at NI_WebServices.lvlib:Error Converter (ErrCode or Status).vi

Possible reason(s):

LabVIEW:  (Hex 0xFFFEFA25) LabVIEW Web Services: ESP Error.


Complete call chain:
     NI_WebServices.lvlib:Error Converter (ErrCode or Status).vi
     NI_WebServices.lvlib:Web Request.lvclass:Render ESP Template.vi
     Test.vi
     Test.vi.ProxyCaller

 

*****************************************************************************************************

8 REPLIES 8
Highlighted
Vsenior
NI Employee (retired)
Solution

Re: LabVIEW Web Service Error on Render ESP Template

Hi John_Neutron,

 

I've been working on your code today and we managed to replicate and fix the error you were seeing.

 

The Web service does call the ESP file and render the page, but it throws the error because the variable you are trying to set has not been properly declared. We managed to make the error dissapear by changing the ESP text file with notepad as follows.

--------------------------
<%
//This is a server side comment
// Variables:
var myvariable;
//
%>

<! Here comes the HTML >

<html>
<head><h1>This is the test template</h1></head>
</br>
<body> This is now the body:

<p>Here comes the varaiable</p>
<p>Variable: @@myvariable</p>

</body>

</html>
---------------------------

Before, you had // in front of the variable (making it a comment) and you didn't have "var" in front of it to say you were declaring anything (this is all in the 4th line). Without the proper declaration, the code throws an error when it is called.

 

Vsenior

John_Neutron
Member

Re: LabVIEW Web Service Error on Render ESP Template

Thanks for your help!

 

I had assummed that I was missing something with the variable decleration.

 

Cheers

 

John

Vsenior
NI Employee (retired)

Re: LabVIEW Web Service Error on Render ESP Template

Hi John_Neutron, 

 

I actually have an Service request open for you after your request for support came through, would you be ok with me closing that off? If you run into more issues, you can call the NI office for help on 01635 523 545. 

 

All teh best

Vsenior

John_Neutron
Member

Re: LabVIEW Web Service Error on Render ESP Template

Yup, feel free to close that.

 

John

John_Neutron
Member

Re: LabVIEW Web Service Error on Render ESP Template

Just as an additional piece of knowledge...

 

I now realize where I was stumbling;

 

I though that the Render ESP Script .vi converted any dyanmic place holders (@@values) into the value that you have set using the Set ESP Variable.vi.

 

On reading the documentation for the Set ESP Variable.vi more closely, I saw that it actually sets values in a Javascript Hash (Key/value pair) called form.

 

So if you want to display the values that you set on the LabVIEW side, you need to use the form["LV_varaible_name"] construct.

 

This can either be done by initializing a variable using var myVariable = form["myVariableFromLabVIEW"] and then you can use  @@myVariable in your .esp file

 

or

 

you can directly insert the form value in the part of the ESP page that renders as html like this;

 

<p> This is my varaible: <% write(form["myVariableFromLabVIEW"]); %> </p>

hidayatmaulud
Member

Re: LabVIEW Web Service Error on Render ESP Template

Message contains a hyperlink Message contains an attachment

Hi VSenior i just beginner for Labview and i would like to learn about web service on labview, I want to stream my video capture from Webcam on MyRio, after looking for many references i found this site https://decibel.ni.com/content/docs/DOC-40808#comment-51856 , I run that project as well as the instruction, but i found the probolem same like John, i have read your solution, but i confused to change the code. Would you like to help me please? 

Maybe after get solution i'll more understand about it. 

 

Thank ya, I'll be happy for your respond Smiley Happy 


Day@
Certified LabVIEW Associate Developer
hidayatmaulud
Member

Re: LabVIEW Web Service Error on Render ESP Template

I have solved my own problem V, I really happy now Smiley Very Happy


Day@
Certified LabVIEW Associate Developer
Vsenior
NI Employee (retired)

Re: LabVIEW Web Service Error on Render ESP Template

Message contains a hyperlink

Hi hidayatmaulud

 

I'm pleased you managed to solve your problem ok! 

 

If you've got questions in the future, you can post in teh forums but I'd recommend starting a new thread for a new question.

 

I have changed jobs since I did this post, and the Applications Engineers who look after the threads might not have seen your request for help on the bottom of an old thread. 

 

All the Best

Vsenior