Found during the pre-release documentation review (#187), by reading the code.
Problem
A WMI array property comes back with only its last element. Examples are IPAddress, IPSubnet and DefaultIPGateway in SELECT * FROM Win32_NetworkAdapterConfiguration, or Capabilities in Win32_DiskDrive.
WS-Management returns an array property as several sibling elements with the same name:
<p:IPAddress>192.0.2.10</p:IPAddress>
<p:IPAddress>fe80::1</p:IPAddress>
When the client builds each row, every element overwrites the previous one, so row.string("IPAddress") is "fe80::1" and the IPv4 address is lost without any error. Every WQL query goes through this code, fluent and legacy API alike.
A related inaccuracy: a WMI NULL (xsi:nil="true") comes back as an empty string, but the WqlRow.get() / string() Javadoc says they return null "when the property is absent or null". Today they only return null when the row has no such property.
Where
WsmanClient.collectRows(...) (src/main/java/org/metricshub/winrm/light/WsmanClient.java):
row.put(((Element) prop).getLocalName(), prop.getTextContent());
Expected
All the values of an array property are kept. How to expose them needs a decision, because the legacy API is consumed as strings (WinRMWqlExecutor.getRows() is List<List<String>>, used by MetricsHub):
- The fluent
WqlRow.get(...) could return a List<String> for an array property.
- The legacy rows need a string. Check what 1.x (tag
v1.1.02, CXF-based) returned for array properties before choosing, so existing consumers keep working.
Also align the WqlRow Javadoc with how a WMI NULL is represented (or map xsi:nil to null, if the legacy API allows it). Then update WQL Queries → Reading the result, which currently says values are the text WinRM sends and a WMI NULL is an empty string.
Found during the pre-release documentation review (#187), by reading the code.
Problem
A WMI array property comes back with only its last element. Examples are
IPAddress,IPSubnetandDefaultIPGatewayinSELECT * FROM Win32_NetworkAdapterConfiguration, orCapabilitiesinWin32_DiskDrive.WS-Management returns an array property as several sibling elements with the same name:
When the client builds each row, every element overwrites the previous one, so
row.string("IPAddress")is"fe80::1"and the IPv4 address is lost without any error. Every WQL query goes through this code, fluent and legacy API alike.A related inaccuracy: a WMI
NULL(xsi:nil="true") comes back as an empty string, but theWqlRow.get()/string()Javadoc says they returnnull"when the property is absent or null". Today they only returnnullwhen the row has no such property.Where
WsmanClient.collectRows(...)(src/main/java/org/metricshub/winrm/light/WsmanClient.java):Expected
All the values of an array property are kept. How to expose them needs a decision, because the legacy API is consumed as strings (
WinRMWqlExecutor.getRows()isList<List<String>>, used by MetricsHub):WqlRow.get(...)could return aList<String>for an array property.v1.1.02, CXF-based) returned for array properties before choosing, so existing consumers keep working.Also align the
WqlRowJavadoc with how a WMINULLis represented (or mapxsi:niltonull, if the legacy API allows it). Then update WQL Queries → Reading the result, which currently says values are the text WinRM sends and a WMINULLis an empty string.