08-18-2009 10:38 AM - edited 08-18-2009 10:39 AM
I am using Labview 8.6 web services to try and output a list of power supplies in a database as XML. When I wire the array to the terminal and set the URL mappings web services won't build because it says it's an unsupported data type. Any help would be appreciated.
Solved! Go to Solution.
08-19-2009 11:23 AM
08-19-2009 01:01 PM
An XML web service in LabVIEW 8.6 supports several data types. An array is not one of those.
The easiest way to get around this limitation would be to use a string indicator instead of the array indicator. Use the Flatten To XML primitive to convert your array into an XML string.
Alternatively, you could set your web service method to use Stream mode instead of Terminal mode. You can then use the Write Response VI in the web services palette to control what to write to the client and when. This seems to be what you meant when you wrote "access to the output".
Incidentally- Arrays can be used as outputs in Terminal mode in LabVIEW 2009.
Nathan
08-19-2009 01:20 PM
Thank you for the information Nathan. Both solutions you mentioned would work for me but I might go the LabView 2009 route as it was able to return this array as JSON data:
{"ps_list_array":[["1","Test PS 1","TCPIP::10.1.1.8::INSTR","This is a test power supply."],["2","Test PS 2","TCPIP::10.1.1.8::INSTR","This is a test power supply 2."],["3","Test PS 2","TCPIP::10.1.1.8::INSTR","This is a test power supply 2."]]}
This is perfect!
12-22-2011 11:55 AM
Is there any way so that one can send data (array 'DBL' & about 60,000 elements) after converting it to a string using 'Flatten to String' function and not using 'Flatten to XML'?
Reason behind using 'Flatten to string' is the size of flattened data is much lesser that it would be in later case.