LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Citadel Web Service on NXG Web Module

Hi Everyone,

 

I'm trying to call NI Citadel using Citadel Web service from web using NXG web module, but I've problem getting the data.

 

Note: 

I'm able to call the web service from LabVIEW (2017) as well as web browser.

 

Below is the address:

http://localhost:3580/nicitadel/trace/LAPTOP-LOTTGM85/My%20Process/My%20Data?OUTPUT_FORMAT=JSON&dbpath=LAPTOP-LOTTGM85%2fDefault_Database

 

And below is the Output:

{ "firstTimestamp":"2019-02-02T22:43:20+07:00", "sampleInterval":1, "data": [0.000000]}

 

I'm having the following error on NXG Web module:

Code: 363650

HttpClientGet in NI::HTTP::httpWebServerClient.sli::httpWebServer_Get->NI::HTTP::GET.gvi->WebApp::Main.gviweb<APPEND>
A network error has occurred. Possible reasons for this error include Cross-Origin Resource Sharing (CORS) configuration issues between the client and the target server or that the client cannot reach the target server. Due to browser security restrictions, detailed information about the cause of the network error cannot be provided. You may find specific details about the cause of the network error in the browser development tools console or in the LabVIEW output window.

 

Thanks & Regards,

 

Irfan

CLD

Thanks & Regards,
Irfan
(CLD)
https://haliatech.com/
0 Kudos
Message 1 of 3
(2,347 Views)

Hi Irfan,

 

I had a chance to look up this error code and found one of our Knowledge Base articles covering this error specifically. The solution presented seems fairly straightforward, so I would give it a try and see if that resolves your issue.

Jacob C.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 3
(2,309 Views)

Thanks Jacob.

 

I saw that link previously and I can add the CORS header on LabVIEW web service and it works.

 

However, I'm not sure how to add it on the Citadel Web service.

I was using following the link here for the: http://zone.ni.com/reference/en-XX/help/371618K-01/lvdscconcepts/dsc_citadel_webservice/

 

The example shipped with LabVIEW call the citadel web service from Flex and C# which I haven't looked into it whether it has CORS problem or not.

 

Thanks,

 

Irfan

 

Thanks & Regards,
Irfan
(CLD)
https://haliatech.com/
0 Kudos
Message 3 of 3
(2,304 Views)