Failed SOAP perl client "proxy: transport protocol not specified"

(imported topic written by SystemAdmin)

See my last post , Javascript example doesn’t work, So I tried the perl example script in R1.

So far, SOAP scripting with Bigfix is still no luck.

  1. here is my version of simple test script, it ended with error on Fedora14-32 OS.

root@t-fedora14-32 bigfix

./bf.pl mypassword

proxy: transport protocol not specified

root@t-fedora14-32 bigfix

cat ./bf.pl

#! /usr/bin/perl

use SOAP::Lite;

#arguments:

password

my $host = “bfxreports.test.com”;

my $name = “addomain\account”;

my $pass = $ARGV[0];

my $RL = “number of bes computers”;

my $username = SOAP::Data->name(‘username’ => $name );

my $password = SOAP::Data->name(‘password’ => $ARGV[0] );

my $expr = SOAP::Data->name(‘relevanceExpr’ => $RL );

my $service = SOAP::Lite -> uri( ‘http://’ . $host . ‘/webreports?wsdl’ ) -> proxy( $host );

#my $service = SOAP::Lite -> uri( ‘http://’ . $host . ‘/webreports?wsdl’ ) ;

my $result = $service -> GetRelevanceResult( $expr, $username, $password );

if( $result->fault )

{

print "faultcode: " . $result->faultcode . “\n”;

print "faultstring: " . $result->faultstring . “\n”;

}

else {

foreach my $answer ( $result->valueof( “//GetRelevanceResultResponse/a” ) )

{

print $answer . “\n”;

}

}

root@t-fedora14-32 bigfix

  1. Here is the perl and SOAP::Lite version info.

root@fl36t-fedora14-32 bigfix

rpm -qa perl-SOAP-Lite

perl-SOAP-Lite-0.711-1.fc14.noarch

root@fl36t-fedora14-32 bigfix

perl -v

This is perl 5, version 12, subversion 3 (v5.12.3) built for i386-linux-thread-multi

Copyright 1987-2010, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the

GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on

this system using “man perl” or “perldoc perl”. If you have access to the

Internet, point your browser at http://www.perl.org/, the Perl Home Page.

root@fl36t-fedora14-32 bigfix

R1: http://support.bigfix.com/product/documents/BigFix_Web_Reports_80_100810.pdf

(imported comment written by Lee Wei)

I tested using SOAP from a Ubuntu box.

I get the same error you got “proxy: transport protocol not specified”.

With the following modification, I was able to connect correctly.

Changed the “my $service…” line to the following:

my $service = SOAP::Lite ->

color=red

ns[/color]( ‘http://’ . $host . ‘/webreports?wsdl’ ) -> proxy(

color=red

‘http://’ .[/color] $host );

I think it has to do with newer version of the SOAP::Lite library.

(imported comment written by SystemAdmin)

A much better message then “proxy:transport protocol not specified”.

I embedded the password as string inside bf.pl

root@t-fedora14-32 bigfix

./bf.pl

faultcode: env:Client

faultstring: Invalid username or password.

root@t-fedora14-32 bigfix

Thanks Wei.

Need to play around to get authentication passed.

tj

(imported comment written by SystemAdmin)

Changed from

my $name = “domain\myaccount”;

to

my $name = “domain\myaccount”;

root@fl36t-fedora14-32 bigfix

./bf.pl

638

root@fl36t-fedora14-32 bigfix

Thanks for Wei’s road block lifting.

tj

(imported comment written by mcalvi91)

I know this is an old post, but I thought Id mention tjyang’s code works on Windows with Active State Perl (listed below) .

#! /usr/bin/perl

use SOAP::Lite;

#arguments:

password

my $host = “BFSERVER.FQDN.com”;

my $name = “username”;

my $pass = $ARGV[0];

my $RL = “number of bes computers”;

my $username = SOAP::Data->name(‘username’ => $name );

my $password = SOAP::Data->name(‘password’ => $ARGV[0] );

my $expr = SOAP::Data->name(‘relevanceExpr’ => $RL );

my $service = SOAP::Lite -> ns( ‘http://’ . $host . ‘/webreports?wsdl’ ) -> proxy( ‘http://’ . $host );

#my $service = SOAP::Lite -> uri( ‘http://’ . $host . ‘/webreports?wsdl’ ) ;

my $result = $service -> GetRelevanceResult( $expr, $username, $password );

if( $result->fault )

{

print "faultcode: " . $result->faultcode . “\n”;

print "faultstring: " . $result->faultstring . “\n”;

}

else {

foreach my $answer ( $result->valueof( “//GetRelevanceResultResponse/a” ) )

{

print $answer . “\n”;

}

}