Hi, everybody
==============
1 my $host = Vim::find_entity_view(view_type => 'HostSystem', filter => {name => $hostname}, properties => ['name', 'network']);
2 print Dumper $host->network;
3 my $network = Vim::get_views(mo_ref_array => $host->network, properties => ['name', 'host', 'vm']);
4 foreach (@$network) {
5 print Dumper $_;
6 }
==============
i ran above code, but i got the error below at lint 3.
==============
Content-Length header value was wrong, fixed at C:/VMware/vSphereCLI5.0/Perl/lib/LWP/Protocol/http.pm line 189.
SOAP Fault:
-----------
Fault string:
Error returned by expat parser: unclosed token
while parsing SOAP body
at line 5, column 3
while parsing SOAP envelope
at line 2, column 3
while parsing HTTP request for method retrieveContents
on object of type vmodl.query.PropertyCollector
at line 1, column 0
Fault detail: InvalidRequestFault
==============
line 2 output details of the networks shown below. yes, the name of network is in UNICODE rather than UTF-8.
==============
$VAR1 = [
bless( {
'value' => 'HaNetwork-VM Network',
'type' => 'Network'
}, 'ManagedObjectReference' ),
bless( {
'value' => "HaNetwork-\x{4eee}\x{60f3}\x{30de}\x{30b7}\x{30f3} \x{30cd}\x{30c3}\x{30c8}\x{30ef}\x{30fc}\x{30af}",
'type' => 'Network'
}, 'ManagedObjectReference' )
];
==============
any hint is appreciated. thanks in advance.