Skip to content

WQL array properties keep only their last element #189

Description

@bertysentry

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.

Activity

  1. self-assigned this
    on Sep 29, 2026
  2. added a commit that references this issue on Sep 29, 2026
    99f8e22
  3. added a commit that references this issue on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions