<commit_before>#!/usr/bin/perl

use lib '../../../build/bindings/perl';
use lib '..';

use openwsman;

# host, port, path, scheme, username, password
$self->{CLIENT} = new openwsman::Client::('localhost', 8889, '/wsman', 'http', 'wsman', 'secret') or die print '<span class="error">[ERROR] Could not create client handler.</span><br/>';

$self->{CLIENT_OPTIONS} = new openwsman::ClientOptions::() or die print '<span class="error">[ERROR] Could not create client options handler.</span><br/>';

my $doc = $self->{CLIENT}->identify($self->{CLIENT_OPTIONS}) or die print '<span class="error">[ERROR] Could not connect to server.</span><br/>';
my $root = $doc->root;
my $prot_version = $root->find($openwsman::XML_NS_WSMAN_ID, "ProtocolVersion")->text();
my $prod_vendor = $root->find($openwsman::XML_NS_WSMAN_ID, "ProductVendor")->text();
my $prod_version = $root->find($openwsman::XML_NS_WSMAN_ID, "ProductVersion")->text();

print "Protocol $prot_version, Vendor $prod_vendor, Version $prod_version\n";<commit_msg>add debug enablement (commented) force basic auth<commit_after>#!/usr/bin/perl

use lib '../../../build/bindings/perl';
use lib '..';

use openwsman;

# debug (to stderr)
# openwsman::set_debug(1);

# host, port, path, scheme, username, password
$self->{CLIENT} = new openwsman::Client::('localhost', 8889, '/wsman', 'http', 'wsman', 'secret') or die print '<span class="error">[ERROR] Could not create client handler.</span><br/>';

# alternate way 
# $self->{CLIENT} = new openwsman::Client::('http://wsman:secret@localhost:8889/wsman') or die print '<span class="error">[ERROR] Could not create client handler.</span><br/>';

$self->{CLIENT_OPTIONS} = new openwsman::ClientOptions::() or die print '<span class="error">[ERROR] Could not create client options handler.</span><br/>';

# force basic auth
$self->{CLIENT}->transport()->set_auth_method($openwsman::BASIC_AUTH_STR);

my $doc = $self->{CLIENT}->identify($self->{CLIENT_OPTIONS}) or die print '<span class="error">[ERROR] Could not connect to server.</span><br/>';
my $root = $doc->root;
my $prot_version = $root->find($openwsman::XML_NS_WSMAN_ID, "ProtocolVersion")->text();
my $prod_vendor = $root->find($openwsman::XML_NS_WSMAN_ID, "ProductVendor")->text();
my $prod_version = $root->find($openwsman::XML_NS_WSMAN_ID, "ProductVersion")->text();

print "Protocol $prot_version, Vendor $prod_vendor, Version $prod_version\n";
{'fraction_non_alphanumeric': 0.2035803497085762, 'fraction_numerical': 0.005412156536219817, 'mean_word_length': 6.556603773584905, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 52, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4098790', 'n_tokens_mistral': 815, 'n_tokens_neox': 817, 'n_words': 190}