NI Home > Community > NI Discussion Forums

LabVIEW Web UI Builder and Data Dashboard

Reply
Member
pgstein
Posts: 19
0 Kudos
Accepted Solution

Unable to retrieve description from web service

[ Edited ]

Hi All,

 

I am developing a web service using LV2009 that i can poll for information for the Web UI Builder.  I got it connected and working, but one day later I am recieving the error 'Unable to retrieve description from web service'.  Has anyway seen this error or know what it means? The web service shows up, but I cannot connect to it.

 

Thanks,

Paul

 

Attached Image: web_builder_error.JPG

Member
malcolmsmith
Posts: 50
0 Kudos

Re: Unable to retrieve description from web service

Hi Paul,

 

Are you still able to manually access the web service in the browser?

 

Additionally, could you see what the following 2 URLs return -

http://101.69.1.108/LVWSSysAdmin/GetAllUserServices
http://101.69.1.108/plant_web_service/WebService.lvwsdsc

 

 

The only time I remember seeing this error before is when someone was using a customized clientaccesspolicy.xml file. For instance, one of the example policy files floating around allows 'ExampleWebService' and 'LVWSSysAdmin', but not 'plant_web_service', so that could be another reason why this error occurs.

Member
pgstein
Posts: 19
0 Kudos

Re: Unable to retrieve description from web service

Yes i can access form my browser.  When I enter either of the URLs suggested, I get a 'cannot connect to the server' error.  Below is my policy file that I have modified using a vi had found. I really don't know too much about what needs to be in the file.

 

 

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<access-policy>
 <cross-domain-access>
  <policy>
   <allow-from http-methods="*" http-request-headers="*">
    <domain uri="http://*.niwsc.com"/>
    <domain uri="https://*.niwsc.com"/>
   </allow-from>
   <grant-to>
    <resource include-subpaths="true" path="/"/>
    <resource include-subpaths="true" path="/plant_ws"/>
    <resource include-subpaths="true" path="/LVWSSysAdmin/GetAllUserServices"/>
    <resource include-subpaths="true" path="//LVWSSysAdmin/GetAllUserServices"/>
   </grant-to>
  </policy>
 </cross-domain-access>
</access-policy>

Member
malcolmsmith
Posts: 50

Re: Unable to retrieve description from web service

Both URLs I pasted should yield a response - the first should be a list of all LabVIEW web services deployed on your machine, and the 2nd should be an XML file describing the inputs/ outputs this specific web service you're trying to import.

 

However, looking at the clientaccesspolicy.xml you posted, the issue may be there. If your web service was originally named 'plant_ws' but was since renamed to 'plant_web_service' as your screenshot shows, this could explain the error.

 

Try using the following policy file to see if it helps:

 

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from http-request-headers="*" http-methods="*">     
        <domain uri="http://*" />
        <domain uri="https://*" />
      </allow-from>     
      <grant-to>     
        <resource path="/" include-subpaths="true" />
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

 

(Note: After changing to this version of the policy file, if you still get the error in the editor, the file may be cached - try restarting the editor, and/or clearing your browser cache / Temporary Internet Files).

Member
pgstein
Posts: 19
0 Kudos

Re: Unable to retrieve description from web service

Thanks. Changing my policy file and clearing my cache seemed to solve the issue!

 

One other question.  If I want to be able to poll the status of an application (such as monitor a plant from your web browser), is my only option to pass my data out as Global/Network Variables?

 

I tried passing it using a queue, but the data doesn't transfer from my VI to the webservice.

 

Thanks alot!

 

Paul

Member
Chris V
Posts: 185
0 Kudos

Re: Unable to retrieve description from web service

Hi pgstein,

 

Queues are the proper way to get data to a web service so that you can publish it to a web browser.  However, if your main application is running as separately from your web services, they are operating in different memory spaces and cannot access each other's queues.

 

There are two options to resolve this:

 

1) Include the main application in the web service build specification as an Auxilliary VI.  Add it to the "Startup VIs" section and select Auxilliary VI instead of Web Service.

 

2) Create an Auxilliary VI (as in step 1) that will read a shared variable from your main application.

 

Either way will allow you to access the queues from the web services and pass the data properly.

 

Have a great day,

 

Chris V

Applications Engineer
National Instruments
Member
pgstein
Posts: 19
0 Kudos

Re: Unable to retrieve description from web service

Hi Chris,

 

What do you mean set as an Auxillary VI? When I add it to "Startup VIs" I see the attached screen.

 

Thanks,

Paul

Member
Chris V
Posts: 185
0 Kudos

Re: Unable to retrieve description from web service

Hi pgstein,

 

It looks like you are using LabVIEW 2009.  The option to add a VI as Auxillary was added in 2010.

 

In this case your best option for getting the data from one data space to another is to use shared variables.  However, it is not recommended to use static shared variables (the icons you drop) in web methods.  The recommended way to access the shared variables in web methods is to use the shared variable API functions found on your Functions Pallete under Data Communication > Shared Variable.

 

Have a great day,

 

Chris V 

Applications Engineer
National Instruments
Member
Olivier-JOURDAN
Posts: 155
0 Kudos

Re: Unable to retrieve description from web service

Hello all,

I'm trying to import web service from cRIO (LV2011 SP1).

I'm getting the error described in the first post.

 

My web service is running correctly (ok from a web browser, OK from LabVIEW using http functions, OK from Web Ui Builder using Http functions).

The original client accessplicy.xml file sounds good for me.

 

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
  <cross-domain-access>
    <!--Enables Silverlight 3 all methods functionality-->
    <policy>
      <allow-from http-request-headers="*" http-methods="*">
        <domain uri="http://*" />
        <domain uri="https://*" />
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true" />
      </grant-to>
    </policy>
    <!--Enables Silverlight 2 clients to continue to work normally -->
    <policy>
      <allow-from http-request-headers="*">
        <domain uri="http://*" />
        <domain uri="https://*" />
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true" />
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

 Anyone has an idea about what I'm doing wrong ?

 

Thanks

 

Olivier

Olivier JOURDAN

SAPHIR | Certified LabVIEW Architect | Topaze on NI Community | LabVIEW add-ons on NI Community |
Member
Olivier-JOURDAN
Posts: 155
0 Kudos

Re: Unable to retrieve description from web service

Problem fixed :smileyhappy:

I/O Variable Remote COnfiguration Web Service 1.0 was not installed on the cRIO.

 

Everthing works fine now.

 

Olivier

Olivier JOURDAN

SAPHIR | Certified LabVIEW Architect | Topaze on NI Community | LabVIEW add-ons on NI Community |