ni.com is currently experiencing slowness/issues due to ongoing maintenance.

Support teams are actively working on the soonest resolution.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NXG GET HTTP from LabView Web Service

Solved!
Go to solution

Hi all.

NXG Newbie

 

Having trouble interpreting this response from HTTP GET

<Response><Terminal><Name>FirstName</Name><Value>Keith</Value></Terminal></Response>

 

Obviously, I am looking to use an indicator named FIrstName to display Keith

 

What is the magic incantation?

 

DeOdderKeith_0-1594869841182.png

What am I missing?

 

Keith

 

0 Kudos
Message 1 of 3
(1,790 Views)
Solution
Accepted by DeOdderKeith

Hi Keith,

 

The response looks to be formatted as XML which NXG does not have built-in support for handling yet. If you need to parse the response as XML there may be exisiting XML libraries that can be migrated to NXG, etc.

 

Looking at the format it does seem like the response is coming from a LabVIEW Web Service. If you have control of the LabVIEW Web Service you can change the response format to JSON:

 

JSONOutputType.gif

 

Then for the following example Web Method:

webmethod.PNG

 

You get the following response:

webmethodresponse.PNG

 

Which can be parsed in LabVIEW NXG using the Unflatten from JSON VI:

nxgunflattenjson.PNG

 

 

 

 

 


Milan
Message 2 of 3
(1,745 Views)

Thanks VERY much !!

0 Kudos
Message 3 of 3
(1,714 Views)