if soap version is specified for probe, don't do both versions

This commit is contained in:
Isaac Connor 2016-10-04 09:51:20 -04:00
parent de22f21813
commit e6626cef69
1 changed files with 51 additions and 44 deletions

View File

@ -41,6 +41,7 @@ require WSDiscovery::TransportUDP;
# Globals
my $verbose = 0;
my $soap_version = undef;
my $client;
# =========================================================================
@ -172,6 +173,8 @@ sub discover
my $uuid_gen = Data::UUID->new();
if ( ( ! $soap_version ) or ( $soap_version eq '1.1' ) ) {
if($verbose) {
print "Probing for SOAP 1.1\n"
}
@ -197,7 +200,9 @@ sub discover
interpret_messages($svc_discover, \%services, @responses);
@responses = ();
} # end if doing soap 1.1
if ( ( ! $soap_version ) or ( $soap_version eq '1.2' ) ) {
if($verbose) {
print "Probing for SOAP 1.2\n"
}
@ -224,6 +229,7 @@ sub discover
})
);
# print $result . "\n";
} # end if doing soap 1.2
interpret_messages($svc_discover, \%services, @responses);
}
@ -321,7 +327,7 @@ my $OPTIONS = "v";
sub HELP_MESSAGE
{
my ($fh, $pkg, $ver, $opts) = @_;
print $fh "Usage: " . __FILE__ . " [-v] probe \n";
print $fh "Usage: " . __FILE__ . " [-v] probe <soap version>\n";
print $fh " " . __FILE__ . " [-v] <command> <device URI> <soap version> <user> <password>\n";
print $fh <<EOF
Commands are:
@ -359,12 +365,13 @@ if(!defined $action) {
}
if($action eq "probe") {
$soap_version = shift;
discover();
}
else {
# all other actions need URI and credentials
my $url_svc_device = shift;
my $soap_version = shift;
$soap_version = shift;
my $username = shift;
my $password = shift;